[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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user