OdooMindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
for rating in self:
name = self.env[rating.res_model].sudo().browse(rating.res_id).display_name
rating.res_name = name or f'{rating.res_model}/{rating.res_id}'