From bdd60a75af2e76d5f1a328b78aae00970130f3d2 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 1 Mar 2016 14:31:35 +0100 Subject: [PATCH] [FIX] crm: default stage When a lead/opportunity is created, the probability must match the probability associated to the stage, as introduced in commit b2733391. However, the call to `_get_default_stage_id` looses the context, which is an issue since the method `stage_find` will inspect it in order to find default values to build the search domain. The result is that the manual call to `_get_default_stage_id` might return a different result than the automatic call from `get_default`, and therefore the probability does not match the stage opw-669960 --- addons/crm/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 237bca7b77b..e80cf5ee285 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -61,7 +61,7 @@ class crm_lead(format_address, osv.osv): def _get_default_probability(self, cr, uid, context=None): """ Gives default probability """ - stage_id = self._get_default_stage_id(cr, uid, context=None) + stage_id = self._get_default_stage_id(cr, uid, context=context) if stage_id: return self.pool['crm.stage'].browse(cr, uid, stage_id, context=context).probability else: