From 4d2e2bbf49cb95c11a871261a6602d6443815764 Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Fri, 15 Feb 2019 08:19:09 +0000 Subject: [PATCH] publish muk_attachment_lobject - 12.0 --- muk_attachment_lobject/__manifest__.py | 2 +- muk_attachment_lobject/models/ir_attachment.py | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/muk_attachment_lobject/__manifest__.py b/muk_attachment_lobject/__manifest__.py index 6940646..8017dff 100644 --- a/muk_attachment_lobject/__manifest__.py +++ b/muk_attachment_lobject/__manifest__.py @@ -20,7 +20,7 @@ { "name": "MuK Large Objects Attachment", "summary": """Large Objects Attachment Location""", - "version": '12.0.2.1.3', + "version": '12.0.2.1.4', "category": 'Extra Tools', "license": "AGPL-3", "website": "http://www.mukit.at", diff --git a/muk_attachment_lobject/models/ir_attachment.py b/muk_attachment_lobject/models/ir_attachment.py index 0fcf9d6..e4e4a91 100644 --- a/muk_attachment_lobject/models/ir_attachment.py +++ b/muk_attachment_lobject/models/ir_attachment.py @@ -48,7 +48,7 @@ class LObjectIrAttachment(models.Model): vals = super(LObjectIrAttachment, self)._get_datas_inital_vals() vals.update({'store_lobject': False}) return vals - + #---------------------------------------------------------- # Function #---------------------------------------------------------- @@ -103,12 +103,8 @@ class LObjectIrAttachment(models.Model): value = attach.datas bin_data = base64.b64decode(value) if value else b'' vals = self._get_datas_inital_vals() - vals.update({ - 'file_size': len(bin_data), - 'checksum': self._compute_checksum(bin_data), - 'index_content': self._index(bin_data, attach.datas_fname, attach.mimetype), - 'store_lobject': bin_data, - }) + vals = self._update_datas_vals(vals, attach, bin_data) + vals['store_lobject'] = bin_data fname = attach.store_fname super(LObjectIrAttachment, attach.sudo()).write(vals) if fname: