Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Base

Entity: ir.attachment

Compute Method: _compute_datas

Inputs Method Outputs
if self.env.context.get('bin_size'):
            for attach in self:
                attach.datas = human_size(attach.file_size)
            return
for attach in self:
            attach.datas = base64.b64encode(attach.raw or b'')

Back to entity