[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user