flectra/addons/crm/wizard/crm_lead_lost.py
2018-01-16 02:34:37 -08:00

17 lines
482 B
Python

# -*- coding: utf-8 -*-
from flectra import api, fields, models
class CrmLeadLost(models.TransientModel):
_name = 'crm.lead.lost'
_description = 'Get Lost Reason'
lost_reason_id = fields.Many2one('crm.lost.reason', 'Lost Reason')
@api.multi
def action_lost_reason_apply(self):
leads = self.env['crm.lead'].browse(self.env.context.get('active_ids'))
leads.write({'lost_reason': self.lost_reason_id.id})
return leads.action_set_lost()