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

View 19.0 View 20.0
Inputs Method Outputs
  • custom_image
  • payment_provider
+ 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
  • image

Back to entity