From 4ef7faeffabed000a7a8bbc1a813a30f458ec40e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 1 Mar 2016 17:30:19 +0100 Subject: [PATCH] [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 --- addons/crm_project_issue/project_issue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm_project_issue/project_issue.py b/addons/crm_project_issue/project_issue.py index 1b71ea74ba7..c9eaa965223 100644 --- a/addons/crm_project_issue/project_issue.py +++ b/addons/crm_project_issue/project_issue.py @@ -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')