[FIX] rating: Typo error

When record.id was not in the dictionary result, it raised a error.

opw:709072
This commit is contained in:
Goffin Simon
2017-02-20 11:40:19 +01:00
parent e1045e4625
commit f63fb28579
+1 -1
View File
@@ -65,7 +65,7 @@ class RatingMixin(models.AbstractModel):
for data in read_group_res:
result[data['res_id']] += data['res_id_count']
for record in self:
record.rating_count = result[record.id]
record.rating_count = result.get(record.id)
def rating_get_partner_id(self):
if hasattr(self, 'partner_id') and self.partner_id: