From 4b1cb41cf7a3f936a1e6d00a2bb6a6a29e82d711 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Mon, 23 Sep 2019 13:41:18 +0000 Subject: [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`. --- odoo/addons/test_new_api/ir.model.access.csv | 1 + 1 file changed, 1 insertion(+) (limited to 'odoo/addons/test_new_api/ir.model.access.csv') diff --git a/odoo/addons/test_new_api/ir.model.access.csv b/odoo/addons/test_new_api/ir.model.access.csv index 112b72e991d..c0fdba1ea2d 100644 --- a/odoo/addons/test_new_api/ir.model.access.csv +++ b/odoo/addons/test_new_api/ir.model.access.csv @@ -41,3 +41,4 @@ access_test_new_api_model_parent,access_test_new_api_model_parent,model_test_new access_test_new_api_model_child,access_test_new_api_model_child,model_test_new_api_model_child,,1,1,1,1 access_test_new_api_model_child_nocheck,access_test_new_api_model_child_nocheck,model_test_new_api_model_child_nocheck,,1,1,1,1 access_test_new_api_display,access_test_new_api_display,model_test_new_api_display,,1,1,1,1 +access_test_new_api_model_active_field,access_test_new_api_model_active_field,model_test_new_api_model_active_field,,1,1,1,1 -- cgit v1.2.3