[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:
Jorge Pinna Puissant
2019-05-08 13:56:08 +00:00
parent 232a7283a5
commit d4317a67d1
+4 -1
View File
@@ -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