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

Module: Point of Sale

Entity: pos.payment.method

Compute Method: _compute_image

Inputs Method Outputs
for record in self:
            if record.custom_image:
                record.image = record.custom_image
            elif record.payment_provider:
                path = f'point_of_sale/static/img/providers/{record.payment_provider}.png'
                try:
                    with file_open(path, 'rb') as image:
                        record.image = BinaryBytes(image.read())
                except OSError:
                    record.image = False

Back to entity