[FIX] crm: default probability in crm lead
When creating a new crm lead from the kanban view, using the quick add button, the default probability is the one of the first stage, and not the one of the selected stage. Now, the default probability is the one of the selected stage. opw-1986047 closes odoo/odoo#33267 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
@@ -54,7 +54,10 @@ class Lead(models.Model):
|
||||
_primary_email = ['email_from']
|
||||
|
||||
def _default_probability(self):
|
||||
stage_id = self._default_stage_id()
|
||||
if 'default_stage_id' in self._context:
|
||||
stage_id = self._context.get('default_stage_id')
|
||||
else:
|
||||
stage_id = self._default_stage_id()
|
||||
if stage_id:
|
||||
return self.env['crm.stage'].browse(stage_id).probability
|
||||
return 10
|
||||
|
||||
Reference in New Issue
Block a user