mirror of
https://github.com/bringout/oca-ocb-crm.git
synced 2026-04-26 15:51:59 +02:00
Initial commit: Crm packages
This commit is contained in:
commit
21a345b5b9
654 changed files with 418312 additions and 0 deletions
28
odoo-bringout-oca-ocb-crm/crm/wizard/crm_lead_lost.py
Normal file
28
odoo-bringout-oca-ocb-crm/crm/wizard/crm_lead_lost.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models, _
|
||||
from odoo.tools.mail import is_html_empty
|
||||
|
||||
|
||||
class CrmLeadLost(models.TransientModel):
|
||||
_name = 'crm.lead.lost'
|
||||
_description = 'Get Lost Reason'
|
||||
|
||||
lost_reason_id = fields.Many2one('crm.lost.reason', 'Lost Reason')
|
||||
lost_feedback = fields.Html(
|
||||
'Closing Note', sanitize=True
|
||||
)
|
||||
|
||||
def action_lost_reason_apply(self):
|
||||
self.ensure_one()
|
||||
leads = self.env['crm.lead'].browse(self.env.context.get('active_ids'))
|
||||
if not is_html_empty(self.lost_feedback):
|
||||
leads._track_set_log_message(
|
||||
'<div style="margin-bottom: 4px;"><p>%s:</p>%s<br /></div>' % (
|
||||
_('Lost Comment'),
|
||||
self.lost_feedback
|
||||
)
|
||||
)
|
||||
res = leads.action_set_lost(lost_reason_id=self.lost_reason_id.id)
|
||||
return res
|
||||
Loading…
Add table
Add a link
Reference in a new issue