Skip to content
Snippets Groups Projects
Commit 4b1cb41c authored by Raphael Collet's avatar Raphael Collet
Browse files

[FIX] models, fields: cache consistency for one2many fields

Issue: after many2one updates, the cache of the corresponding one2many
fields was inconsistent when the latter depends on `active_test`.  One
of the values in cache was updated, while the other was left intact.

We simplify the cache by not making the field depend on context: the
cache value contains all the records in the relation (corresponding to
`active_test=False`).  The value of the field is automatically filtered
by the `active` field when the value is accessed.

This makes it easier to maintain the cache value, guarantees its
consistency, and avoids queries to read the one2many field with
`active_test=False`, after having set it with `active_test=True`.
parent 333f1087
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment