From 00a24a1f2012e5dab4a2ae87ba247d6f7f0c49e6 Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Sun, 21 Jul 2019 19:33:29 +0000 Subject: [PATCH] publish muk_utils - 12.0 --- muk_utils/models/ir_attachment.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/muk_utils/models/ir_attachment.py b/muk_utils/models/ir_attachment.py index 58caa63..36421e1 100644 --- a/muk_utils/models/ir_attachment.py +++ b/muk_utils/models/ir_attachment.py @@ -97,16 +97,15 @@ class IrAttachment(models.Model): '&', storage_domain[self._storage()], '|', ('res_field', '=', False), ('res_field', '!=', False) ] - self.env.cr.commit() self.search(record_domain).migrate() return True @api.multi def migrate(self): + self.env.cr.commit() storage_location = self._storage().upper() batch_size = self.env.context.get('migration_batch_size', 100) batches_to_migrate = math.ceil(len(self) / batch_size) - for batch_index, sub_ids in enumerate(split_every(batch_size, self.ids)): with api.Environment.manage(): with registry(self.env.cr.dbname).cursor() as batch_cr: