2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra import api, fields, models
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
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()
|