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] base_automation: improve performance - Backport of fd59c74 master #376

Open MitchelHdz opened 3 years ago

MitchelHdz commented 3 years ago

[IMP] base_automation: Return early if there are not base.automation to process

This is a backport from odoo/master to Vauxoo/12.0

Original Commit Message:

Installing base_automation module the methods: create, write, unlink and compute_field
are patched.
So, they will be used  for all models.
It is important to save resources as possible.

The patched methods in base.automation read the original data
before to change so run all base.automation records.

But What about if there are not base.automation records?
So, we can save an extra read for all models

The same to pre-filter and post-filter
It adds a return early in order to skip this extra task when it will be useless.

Co-authored-by: Moises Lopez moylop260@vauxoo.com

Original commit: https://github.com/odoo/odoo/pull/52134/commits/fd59c74255462cc9ca2165213edf4ab48dc25dd2

It will be open in order to use as patch in our patches.txt in order to improve the automated actions performance.

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

MitchelHdz commented 3 years ago

Hello @moylop260, could you check this? thanks!

moylop260 commented 3 years ago

LGTM Thank you!