From ad065093eb595e0b26dfd6d245e1b598d70e9d87 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 22 Nov 2018 10:59:09 +0000 Subject: [FIX] models: ormcache invalidation on import Do not propagate cache invalidations to other workers when changes must be discarded, because of an import error or a dry run, which are both handled as successful transactions. --- odoo/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'odoo/models.py') 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} -- cgit v1.2.3