I want to get the size in byte of the attached pdf files
Class Attachment (), has a function get_size() and data_size(). However it does not return the value.
data_size = fields.Function(fields.Integer('Data size', states={
'invisible': Eval('type') != 'data',
}, depends=['type']), 'get_size')
def get_size(self, name):
with Transaction().set_context({
'%s.%s' % (self.__name__, name): 'size',
}):
record = self.__class__(self.id)
return record.data