From f7ec48b6dff7ae89104a369494f5825083a44bd2 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 16 Jun 2016 15:29:05 +0200 Subject: [PATCH] [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 --- addons/crm/crm_stage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_stage.py b/addons/crm/crm_stage.py index 92fb1efa05d..d6fa3e74cce 100644 --- a/addons/crm/crm_stage.py +++ b/addons/crm/crm_stage.py @@ -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