laradoo icon indicating copy to clipboard operation
laradoo copied to clipboard

how to create a custom method call with passing object.

Open secmohammed opened this issue 4 years ago • 1 comments

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.?

secmohammed avatar Feb 15 '21 17:02 secmohammed

//Try this code $stock_picking_id = 2; $result=$odoo->call( 'stock.picking', 'action_confirm', [(int)$stock_picking_id]
);

ahmadproper avatar Mar 19 '21 03:03 ahmadproper