Skip to content
Snippets Groups Projects
Commit bd7ed457 authored by Maruan Aguerdouh (magm)'s avatar Maruan Aguerdouh (magm)
Browse files

[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#119987

X-original-commit: 3834577a
Signed-off-by: default avatarMaruan Aguerdouh Mohtar (magm) <magm@odoo.com>
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent b3322ecc
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,9 @@
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
if record:
if not 'opportunity' in records.mapped('type'):
records.action_set_lost()
elif records:
action_values = env.ref('crm.crm_lead_lost_action').sudo().read()[0]
action_values.update({'context': env.context})
action = action_values
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment