mirror of
https://github.com/bringout/oca-ocb-crm.git
synced 2026-04-24 08:32:03 +02:00
19.0 vanilla
This commit is contained in:
parent
dc68f80d3f
commit
7221b9ac46
610 changed files with 135477 additions and 161677 deletions
|
|
@ -1,7 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models, _
|
||||
from markupsafe import Markup
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.tools.mail import is_html_empty
|
||||
|
||||
|
||||
|
|
@ -9,20 +10,21 @@ class CrmLeadLost(models.TransientModel):
|
|||
_name = 'crm.lead.lost'
|
||||
_description = 'Get Lost Reason'
|
||||
|
||||
lead_ids = fields.Many2many('crm.lead', string='Leads', context={"active_test": False})
|
||||
lost_reason_id = fields.Many2one('crm.lost.reason', 'Lost Reason')
|
||||
lost_feedback = fields.Html(
|
||||
'Closing Note', sanitize=True
|
||||
)
|
||||
|
||||
def action_lost_reason_apply(self):
|
||||
"""Mark lead as lost and apply the loss reason"""
|
||||
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>' % (
|
||||
self.lead_ids._track_set_log_message(
|
||||
Markup('<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)
|
||||
res = self.lead_ids.action_set_lost(lost_reason_id=self.lost_reason_id.id)
|
||||
return res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue