Vauxoo / odoo

Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
https://www.odoo.com
Other
9 stars 9 forks source link

[IMP] models.py: Method search_read propagate kwargs to read method #395

Closed fernandahf closed 2 years ago

fernandahf commented 3 years ago

Currently the method read uses by default the parameter load='classic_read')

So, it computes name_get for all m2o fields for all records in self.

If you want to avoid computing the name_get to save time and process You can use an empty string in load parameter:

The method self.search_read call to search and read methods but search_read method is not possible to assign load='' argument (or other arguments of the method read)

So, you need to use 2 lines of code: records = self.search(...) records.read(..., load='')

This commit changes search_read method to receive all keyword arguments of the method read So, you can use self.search_read(..., load='') and the read parameter will be propagated

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr