diff --git a/muk_utils/__manifest__.py b/muk_utils/__manifest__.py index 2d52aad..3078cec 100644 --- a/muk_utils/__manifest__.py +++ b/muk_utils/__manifest__.py @@ -22,7 +22,7 @@ { "name": "MuK Utils", "summary": """Utility Features""", - "version": '12.0.2.0.0', + "version": '12.0.2.0.1', "category": 'Extra Tools', "license": "LGPL-3", "author": "MuK IT", diff --git a/muk_utils/models/ir_attachment.py b/muk_utils/models/ir_attachment.py index 9fc298f..58caa63 100644 --- a/muk_utils/models/ir_attachment.py +++ b/muk_utils/models/ir_attachment.py @@ -97,6 +97,7 @@ 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 @@ -105,6 +106,7 @@ class IrAttachment(models.Model): 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: