From e65b98524e3a394dec4ce70208ce6b86b3dd13b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 28 Sep 2023 17:44:29 +0200 Subject: [PATCH] Do not store in transaction cache instances of Reference fields If the target of the Reference field is deleted, the transaction cache is not cleared because there is no "ON DELETE" support for Reference field. Instead the ids are checked in the Reference.get method. Closes #12599 --- trytond/trytond/model/modelstorage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/model/modelstorage.py b/trytond/trytond/model/modelstorage.py index 6fa12bfb44..e59926176c 100644 --- a/trytond/trytond/model/modelstorage.py +++ b/trytond/trytond/model/modelstorage.py @@ -1811,7 +1811,8 @@ class ModelStorage(Model): # create browse records for 'remote' models no_local_cache = {'binary'} if not transaction.readonly: - no_local_cache |= {'one2one', 'one2many', 'many2many'} + no_local_cache |= { + 'one2one', 'one2many', 'many2many', 'reference'} for data in read_data: id_ = data['id'] to_delete = set()