Merge lp:~sebastien.beau/openerp-connector/openerp-connector-fix-useless-fire-sparse-fields into lp:~openerp-connector-core-editors/openerp-connector/7.0
Proposed by
Sébastien BEAU - http://www.akretion.com
| Status: | Needs review |
|---|---|
| Proposed branch: | lp:~sebastien.beau/openerp-connector/openerp-connector-fix-useless-fire-sparse-fields |
| Merge into: | lp:~openerp-connector-core-editors/openerp-connector/7.0 |
| Diff against target: |
16 lines (+4/-1) 1 file modified
connector/producer.py (+4/-1) |
| To merge this branch: | bzr merge lp:~sebastien.beau/openerp-connector/openerp-connector-fix-useless-fire-sparse-fields |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Guewen Baconnier @ Camptocamp | code review, no test | Needs Fixing | |
|
Review via email:
|
|||
Description of the change
Hi
When we write in a sparse fields (it's inherit the function fields) OpenERP will write into the serialized fields.
This mean that if I update X sparse fields on the product, the producer will fire X+1 even and so X+1 job.
The easy way to fix it is to not fire an even if the key updated is only the serialized fields.
What do you think?
Thanks
To post a comment you must log in.
Unmerged revisions
- 579. By Sébastien BEAU - http://www.akretion.com
-
[FIX] fix useless fire on when writing on a sparse fields
Hi,
Thanks for your MP.
Can you add the test as well please (for a write in a serialized field too)?
Could I propose to rename 'keys' to 'fields'?
I think we can have a more clever fix for not much work. I'm maybe wrong without investigating further, but I'm sure you'll stop me in such case ;-)
If we write directly in a serialized field, we know the fields we are writing on. fire_serialized ' is present in the context. '__do_not_ fire_serialized ' has to be put in the context given to the `write_original` method.
I would propose to:
Fire vals.keys() + serialized.keys(), unless if '__do_not_
Thus, fire_serialized '
* if we write directly to sparse fields -> ok because the many writes on the serialized will be skipped due to the presence of the sentinel '__do_not_
* If we write directly to a serialized field -> ok because the fields keys will be present in the first fire