I am trying to define a method @api.model:
@api.model
def test(param1, param2):
print model.env['product.template'].search([("company_id", "=", param1), ("warehouse_id", "=", param2), ])
Question is, official documentation states that you can use model.env but when I try to do it I get:
NameError: global name 'model' is not defined
which is the right import to use to get model available?