changeset 7166741cf718 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=7166741cf718
description:
        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
diffstat:

 trytond/ir/attachment.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 01d7e3066af2 -r 7166741cf718 trytond/ir/attachment.py
--- a/trytond/ir/attachment.py  Mon Oct 18 15:56:58 2021 +0200
+++ b/trytond/ir/attachment.py  Tue Oct 19 00:22:08 2021 +0200
@@ -88,7 +88,7 @@
 
     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

Reply via email to