laradoo
laradoo copied to clipboard
how to create a custom method call with passing object.
Hello, I wanted to make a custom method call at a certain module, and pass an object of another model as this method accepts an object. I tried to send in form of array, json, but no matter what parameter is passed, It throws the error that the parameter is required. so there are two questions here.
- how to pass a parameter to a function using call method.
- is it possible to pass an object of another entity to the call method as parameter and odoo recognizes that.?
//Try this code
$stock_picking_id = 2;
$result=$odoo->call(
'stock.picking',
'action_confirm',
[(int)$stock_picking_id]
);