Code review comment for lp:~sebastien.beau/openerp-connector/openerp-connector-fix-useless-fire-sparse-fields

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

> <...>
> Fire vals.keys() + serialized.keys(), unless if '__do_not_fire_serialized' is present in the context. >'__do_not_fire_serialized' has to be put in the context given to the

Should be actually something as follows :
    fields = vals.keys()
    for each serialized field: # pseudo code
        fields = set(vals.keys()).update(serialized.keys())
        fields.remove(field_serialized)
where serialized is the the dict of serialized vals and field_serialized the name of the field

> <...>
>
> Thus,
> * 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_fire_serialized'
> * If we write directly to a serialized field -> ok because the fields keys
> will be present in the first fire

Hmm I inversed some things here, but I think you understood me.

Note that your fix is failing if we update 2 fields where 1 of them is a serialized.

When I

« Back to merge proposal