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

Module: Base Attachment Object Store

Entity: ir.attachment

Compute Method: _compute_fs_storage_id

Inputs Method Outputs
for rec in self:
            if rec.store_fname:
                code = rec.store_fname.partition("://")[0]
                fs_storage = self.env["fs.storage"].sudo().get_by_code(code)
                if fs_storage != rec.fs_storage_id:
                    rec.fs_storage_id = fs_storage
            elif rec.fs_storage_id:
                rec.fs_storage_id = None

Back to entity