From 47d7c054a80517e8983ee7248521b81d8dbda4de Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Thu, 17 Jan 2019 10:28:50 +0000 Subject: [PATCH] publish muk_attachment_lobject - 12.0 --- muk_attachment_lobject/models/ir_attachment.py | 2 +- muk_attachment_lobject/tests/test_attachment.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/muk_attachment_lobject/models/ir_attachment.py b/muk_attachment_lobject/models/ir_attachment.py index 6e1be28..94c8d85 100644 --- a/muk_attachment_lobject/models/ir_attachment.py +++ b/muk_attachment_lobject/models/ir_attachment.py @@ -64,7 +64,7 @@ class LObjectIrAttachment(models.Model): for attach in self: if attach.store_lobject: if bin_size: - attach.datas = attach.store_lobject + attach.datas = attach.with_context({'human_size': True}).store_lobject else: attach.datas = attach.with_context({'base64': True}).store_lobject else: diff --git a/muk_attachment_lobject/tests/test_attachment.py b/muk_attachment_lobject/tests/test_attachment.py index defcd5a..a7a496f 100644 --- a/muk_attachment_lobject/tests/test_attachment.py +++ b/muk_attachment_lobject/tests/test_attachment.py @@ -45,6 +45,9 @@ class AttachmentTestCase(common.HttpCase): 'datas': base64.b64encode(b"\xff data")}) self.assertTrue(attach.datas) self.assertTrue(attach.with_context({'bin_size': True}).datas) + self.assertTrue(attach.with_context({'human_size': True}).datas) + self.assertTrue(attach.with_context({'base64': True}).datas) + self.assertTrue(attach.with_context({'stream': True}).datas) oid = attach.with_context({'oid': True}).store_lobject self.assertTrue(oid) attach.write({'datas': base64.b64encode(b"\xff data")})