From d4317a67d1f7bcf8c9336111408f6f12ac5b1e2c Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Wed, 8 May 2019 13:56:08 +0000 Subject: [PATCH] [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) --- addons/crm/models/crm_lead.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 74e3ac592a2..b704979de85 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -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