Browse Source

publish muk_utils - 12.0

pull/30/head
MuK IT GmbH 5 years ago
parent
commit
d49cd90cb3
  1. 2
      muk_utils/__manifest__.py
  2. 8
      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.5',
"version": '12.0.2.0.6',
"category": 'Extra Tools',
"license": "LGPL-3",
"author": "MuK IT",

8
muk_utils/models/ir_attachment.py

@ -107,9 +107,13 @@ class IrAttachment(models.Model):
storage_location = self._storage().upper()
batches = math.ceil(len(self) / batch_size)
for index, attachment in enumerate(self, start=1):
current_batch = math.ceil(index / batch_size)
counter = len(self) - (batches - 1) * batch_size
counter = counter if current_batch == batches else batch_size
_logger.info("Migrate Attachment %s of %s to %s [Batch %s of %s]",
index % batch_size or batch_size, batch_size, storage_location,
math.ceil(index / batch_size), batches
index % batch_size or batch_size, counter,
storage_location, current_batch, batches
)
attachment.with_context(migration=True).write({
'datas': attachment.datas

Loading…
Cancel
Save