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 |
|---|---|---|
|
- 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) + message.rating_value = message.rating_id.rating if message.rating_id else 0.0 |
|
