[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
This commit is contained in:
Nicolas Martinelli
2016-03-01 17:49:40 +01:00
parent d3ea95db51
commit 4ef7faeffa
+2 -2
View File
@@ -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')