Browse Source

publish muk_utils - 12.0

pull/30/head
MuK IT GmbH 5 years ago
parent
commit
af05335306
  1. 2
      muk_utils/__manifest__.py
  2. 5
      muk_utils/models/ir_attachment.py

2
muk_utils/__manifest__.py

@ -22,7 +22,7 @@
{
"name": "MuK Utils",
"summary": """Utility Features""",
"version": '12.0.2.0.3',
"version": '12.0.2.0.4',
"category": 'Extra Tools',
"license": "LGPL-3",
"author": "MuK IT",

5
muk_utils/models/ir_attachment.py

@ -102,7 +102,8 @@ class IrAttachment(models.Model):
@api.multi
def migrate(self, batch_size=None):
batch_size = batch_size or batch_size
commit_on_batch = bool(batch_size)
batch_size = batch_size or len(self)
storage_location = self._storage().upper()
batches = math.ceil(len(self) / batch_size)
for index, attachment in enumerate(self, start=1):
@ -113,7 +114,7 @@ class IrAttachment(models.Model):
attachment.with_context(migration=True).write({
'datas': attachment.datas
})
if batch_size and not index % batch_size:
if commit_on_batch and not index % batch_size:
self.env.cr.commit()
#----------------------------------------------------------

Loading…
Cancel
Save