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
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user