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: mail.message

Compute Method: _compute_rating_value

Inputs Method Outputs
  • id
ratings = self.env['rating.rating'].search([('message_id', 'in', self.ids), ('consumed', '=', True)], order='create_date DESC')
mapping = dict((r.message_id.id, r.rating) for r in ratings)
for message in self:
            message.rating_value = mapping.get(message.id, 0.0)

Back to entity