From 6a5cc4c7b47df1f1c622f7d688b615b4d817c15b Mon Sep 17 00:00:00 2001 From: "Maruan Aguerdouh (magm)" Date: Fri, 27 Jan 2023 13:28:53 +0000 Subject: [PATCH] [FIX] crm: lost button don't trigger lost reason popup in list for leads Steps to reproduce: - Install crm - Go to settings and activate leads in crm. - Go to leads list and select any lead, now mark it as lost. Issue: It will ask for lost reason. But if we do it from the Leads form view, we don't get to set any reason. I discussed with the PO and we don't want to add the lost reason in the leads. Solution: Modified action of lost so it takes leads into account. opw-3119748 closes odoo/odoo#120033 X-original-commit: 3834577a8beec2f9eb4a30dd8a0ae72403041af5 Signed-off-by: Maruan Aguerdouh Mohtar (magm) --- addons/crm/data/ir_action_data.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/crm/data/ir_action_data.xml b/addons/crm/data/ir_action_data.xml index e522a52b5a3..b4c3a282f38 100644 --- a/addons/crm/data/ir_action_data.xml +++ b/addons/crm/data/ir_action_data.xml @@ -10,7 +10,12 @@ list code - action = model.action_set_lost_with_reason() + +if not 'opportunity' in records.mapped('type'): + action = records.action_set_lost() +else: + action = model.action_set_lost_with_reason() +