[IMP] *: optimize code with search_fetch() and fetch()
closes odoo/odoo#112126 Related: odoo/enterprise#36782 Signed-off-by: Raphael Collet <rco@odoo.com>
This commit is contained in:
@@ -13,7 +13,7 @@ class ResCompany(models.Model):
|
||||
)
|
||||
existing_companies = companies.exists()
|
||||
# prefetch both fields
|
||||
existing_companies.read(["fiscalyear_last_day", "fiscalyear_last_month"])
|
||||
existing_companies.fetch(["fiscalyear_last_day", "fiscalyear_last_month"])
|
||||
results = []
|
||||
|
||||
for data, company in zip(payload, companies):
|
||||
|
||||
Reference in New Issue
Block a user