changes
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo import api, fields, models
|
||||
|
||||
from .fp_notification_template import TRIGGER_EVENTS
|
||||
|
||||
@@ -29,3 +29,20 @@ class FpNotificationLog(models.Model):
|
||||
)
|
||||
error_message = fields.Text(string='Error Message')
|
||||
mail_mail_id = fields.Many2one('mail.mail', string='Mail Record')
|
||||
|
||||
@api.depends('template_id', 'partner_id', 'sent_date', 'status')
|
||||
def _compute_display_name(self):
|
||||
trigger_labels = dict(self._fields['trigger_event'].selection)
|
||||
for rec in self:
|
||||
bits = []
|
||||
label = (
|
||||
rec.template_id.display_name
|
||||
or trigger_labels.get(rec.trigger_event)
|
||||
or 'Notification'
|
||||
)
|
||||
bits.append(label)
|
||||
if rec.partner_id:
|
||||
bits.append('→ %s' % rec.partner_id.display_name)
|
||||
if rec.sent_date:
|
||||
bits.append(rec.sent_date.strftime('%Y-%m-%d %H:%M'))
|
||||
rec.display_name = ' '.join(bits)
|
||||
|
||||
Reference in New Issue
Block a user