[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
This commit is contained in:
Nicolas Martinelli
2016-03-01 17:39:14 +01:00
parent a46a3f9958
commit bdd60a75af
+1 -1
View File
@@ -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: