changeset 3de5a88c76dd in trytond:5.0
details: https://hg.tryton.org/trytond?cmd=changeset&node=3de5a88c76dd
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
        (grafted from 7166741cf718c8750d1dae951df49eec989e2d7b)
diffstat:

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

diffs (12 lines):

diff -r 77ab3a4e6165 -r 3de5a88c76dd trytond/ir/attachment.py
--- a/trytond/ir/attachment.py  Fri Oct 15 17:09:30 2021 +0200
+++ b/trytond/ir/attachment.py  Tue Oct 19 00:22:08 2021 +0200
@@ -90,7 +90,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