Search code examples
phpodooxml-rpcinvoiceodoo-16

Odoo 16 - XMLRPC PHP Problem to retrieve invoices following update from 15 to 16


Good morning, I have a problem since updating my odoo from version 15 to 16. I can no longer retrieve invoices by their numbers. The function worked in version 15 but returns nothing since the update

My function : $result = $models->execute_kw($this->base, $uid, $this->pass, 'account.move', 'search_read', array(array(array('ref', '=', "20230307118"))));

This returns me: Array ( )

I specify that the invoice I am looking for exists in the database

Do you know why this no longer works?

I tried the same function but adapted for the res.partner table and I don't encounter any problems

Thank you


Solution

  • I finally contacted odoo who told me that there seems to be a bug in the search_read functions. It is possible in version 15 to specify no return fields to have them all. But in version 16, not specifying return fields returns either nothing or an error.