-
- Downloads
[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`.
Showing
- odoo/addons/test_new_api/ir.model.access.csv 1 addition, 0 deletionsodoo/addons/test_new_api/ir.model.access.csv
- odoo/addons/test_new_api/models.py 10 additions, 1 deletionodoo/addons/test_new_api/models.py
- odoo/addons/test_new_api/tests/test_new_fields.py 44 additions, 0 deletionsodoo/addons/test_new_api/tests/test_new_fields.py
- odoo/fields.py 18 additions, 19 deletionsodoo/fields.py
Loading
Please register or sign in to comment