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: Return early if there are not base.automation to process #391

Closed fernandahf closed 2 years ago

fernandahf commented 3 years ago

Description of the issue/feature this PR addresses:

Installing base_automation module the methods: create, write. 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.

Current behavior before PR: Methods create, write, read for all models even if there not base.automation records.

Desired behavior after PR is merged: Methods create, write, read the original data before to change to return early.

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