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_res_name

View 17.0 View 19.0
Inputs Method Outputs
  • res_model
  • res_id
for rating in self:
-             name = self.env[rating.res_model].sudo().browse(rating.res_id).display_name
+             if rating.res_model and rating.res_id:
+                 name = self.env[rating.res_model].sudo().browse(rating.res_id).display_name
+             else:
+                 name = False
            rating.res_name = name or f'{rating.res_model}/{rating.res_id}'
  • res_name

Back to entity