summaryrefslogtreecommitdiff
path: root/odoo/models.py
diff options
context:
space:
mode:
authorRobot Odoo <xmo+roboto@odoo.com>2018-11-23 16:04:32 +0100
committerGitHub <noreply@github.com>2018-11-23 16:04:32 +0100
commitcd2637cfdf0ec2c5dc2fa2b74b29fdffac822e87 (patch)
treee26966ed9e8d8b75a05b86870b9a8c6515a5f871 /odoo/models.py
parent904989215212160741d54062d57ea9d0bb0f3b46 (diff)
parentc96d4cdbadf8d15abcad19e8f5839b46bb025e04 (diff)
[MERGE] Avoid some unnecessary ormcache invalidations
Avoid invalidating ormcache when possible. There are currently too many invalidations, which makes the ormcache less effective in practice. closes odoo/odoo#28993
Diffstat (limited to 'odoo/models.py')
-rw-r--r--odoo/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/odoo/models.py b/odoo/models.py
index 1af6cd9c173..b2aab1d5f36 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -846,7 +846,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
ids = []
messages = []
ModelData = self.env['ir.model.data']
- ModelData.clear_caches()
# list of (xid, vals, info) for records to be created in batch
batch = []
@@ -928,6 +927,8 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
if any(message['type'] == 'error' for message in messages):
cr.execute('ROLLBACK TO SAVEPOINT model_load')
ids = False
+ # cancel all changes done to the registry/ormcache
+ self.pool.reset_changes()
return {'ids': ids, 'messages': messages}