Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

empty recordset. Why?

In a Odoo 14 shell, I’m doing this

env['model_A'].search(['model_B_id', '=', '17' ])

I know for sure that there are several records in model_A with the field model_B_id set to 17

I get an empty recordset back

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

model_A()

Why ?

>Solution :

The correct form of the search is

env['model_A'].search([('model_B_id', '=', 17)])

Elements to search must be a list of tuples and the many2one relation need an integer

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading