Merge lp:~openerp-dev/openobject-server/6.0-server-fix-stored-function-triggers into lp:openobject-server/6.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-server/6.0-server-fix-stored-function-triggers |
Merge into: | lp:openobject-server/6.0 |
Diff against target: |
118 lines (+54/-38) 1 file modified
bin/osv/orm.py (+54/-38) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/6.0-server-fix-stored-function-triggers |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Publisher's Warranty Team | Pending | ||
Review via email: mp+53772@code.launchpad.net |
Description of the change
Rewrite of ORM's _store_get_values() used to generate the list of stored function fields that need to be recomputed as a result of any create/write/unlink operation.
This rewrite attempts to make the code a bit more readable (had a headache just reading the previous version), but most importantly changes the logic to respect *all* priorities set on the function fields's triggers.
The previous version of this code only considered the priority of the first function field found for each model, hence causing hard-to-diagnose issues during updates of objects with complex inter-dependent fields.
This changes allows fixing bug 715470 as explained in the related merge proposal for addons:
https:/
Once merged in 6.0, this fix will be forward-ported to trunk.
Unmerged revisions
- 3367. By Olivier Dony (Odoo)
-
[FIX] orm: rewrote and fixed _store_get_values to properly respect priority
_store_get_values is in charge of gathering the list of
function fields that should be recomputed as a result
of any write() operation, due to store flag triggers.
The previous version would group fields by model and
only respect the priority of the first trigger for a
given model, creating various problems when priority
of field computation is important.
The new version tries to be more readable and respect
all priorities.
Note that the comments on top about the structure of _inherits and _inherit_fields are not really related to this issue, they're just provided for reference.