In the latest Odoo, usage of Api decorators (api.onchange) to perform onchange functionalities eases our job,
however I wonder how to call such onchange methods into another method, by passing those required parameters.
Let me take an example of SaleOrderLine object& its onchange method, say product_id_change
Standard definition of product_id_change is something like as follows:
@api.onchange('product_id')
def product_id_change(self):
if not self.product_id:
return {'domain': {'product_uom': []}}
...
Now, say in my custom module/method, am trying to call this onchange method, as it would be easier to create Sale-Order-line using those returned vals.
If it was traditional method, then I could have simply called it by passing its parameter as follows
sol_obj.product_id_change(PRODUCT_ID)
which would have returned those desired vals, however since we happen to use API decorator, I wonder how to pass those parameter.