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

Module: Customer Rating

Entity: rating.rating

Compute Method: _compute_rating_image

Inputs Method Outputs
self.rating_image_url = False
self.rating_image = False
for rating in self:
            image_path = f'rating/static/src/img/{rating._get_rating_image_filename()}'
            rating.rating_image_url = f'/{image_path}'
            try:
                with file_open(image_path, 'rb', filter_ext=('.png',)) as f:
                    rating.rating_image = base64.b64encode(f.read())
            except OSError:
                rating.rating_image = False

Back to entity