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

Module: Companyweb

Entity: res.partner

Compute Method: _compute_cweb_image

Inputs Method Outputs
for rec in self:
            if rec.cweb_image:
                img_url = tools.misc.file_path(
                    f"companyweb_base/static/img/cweb_barometer/{rec.cweb_image}"
                )
                if img_url:
                    img_url = (
                        "/companyweb_base/static/img/cweb_barometer/%s" % rec.cweb_image
                    )
                    rec.cweb_image_tag = '<img src="%s"/>' % img_url
                else:
                    rec.cweb_image_tag = None
            else:
                rec.cweb_image_tag = None

Back to entity