Skip to content
Snippets Groups Projects
Commit 4ef7faef authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] crm_project_issue: archive instead of delete

When the user converts the lead into an issue, an error occurs: "Form
view couldn't be loaded". This is because the web layer tries to refresh
the data related to a deleted record.

Instead of deleting the lead, we archive it.

opw-670259
parent d3ea95db
Branches
Tags
No related merge requests found
......@@ -44,8 +44,8 @@ class crm_lead_to_project_issue_wizard(osv.TransientModel):
issue = Issue.browse(cr, uid, issue_id, context=None)
# move the mail thread
Lead.message_change_thread(cr, uid, [lead.id], issue, context=context)
# delete the lead
Lead.unlink(cr, uid, [lead.id], context=None)
# Archive the lead
Lead.write(cr, uid, [lead.id], {'active': False}, context=context)
# return the action to go to the form view of the new Issue
view_id = self.pool['ir.model.data'].xmlid_to_res_id(
cr, uid, 'project_issue.project_issue_form_view')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment