From e644d6a4eb01570d879b27e880b48dcd14681476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 19 Oct 2021 00:22:08 +0200 Subject: [PATCH] Set the target field name in the context to get the size The getter of 'data_size' field must use the name 'data' in the context instead of 'data_size'. issue10849 review383301002 --- trytond/ir/attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/ir/attachment.py b/trytond/ir/attachment.py index 422e367084..bc659687ad 100644 --- a/trytond/ir/attachment.py +++ b/trytond/ir/attachment.py @@ -88,7 +88,7 @@ class Attachment(ResourceMixin, ModelSQL, ModelView): def get_size(self, name): with Transaction().set_context({ - '%s.%s' % (self.__name__, name): 'size', + '%s.%s' % (self.__name__, name[:-len('_size')]): 'size', }): record = self.__class__(self.id) return record.data