[FIX] crm: needed _order for group by crm.stage

When grouping result the BaseModel method _read_group_fill_results add
the possible groups which had no result.

But, if the order of the group is not consistent, we can get really
wrong results. The code logic is expecting that the grouped result
gotten and the list of groups (returned by _read_group_stage_ids of
crm.lead) is in the same order.

If the _order attribute of the model is not enough specific (as was the
case in crm.stage) the inconsistent order would kill aggregation values
(displaying 0 instead of what should have been present).

opw-680952
This commit is contained in:
Nicolas Lempereur
2016-06-16 15:38:27 +02:00
parent a59703e652
commit f7ec48b6df
+1 -1
View File
@@ -20,7 +20,7 @@ class crm_stage(osv.Model):
_name = "crm.stage"
_description = "Stage of case"
_rec_name = 'name'
_order = "sequence"
_order = "sequence, name, id"
def _default_team_ids(self, cr, uid, context=None):
return context.get('default_team_id') and [(6, 0, [context['default_team_id']])] or False