You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
619 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/>
  3. # License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html).
  4. from odoo import models, api
  5. class MailMessage(models.Model):
  6. _inherit = 'mail.message'
  7. @api.multi
  8. def message_format(self):
  9. messages_values = super(MailMessage, self).message_format()
  10. for i in messages_values:
  11. if i['channel_ids']:
  12. i['channel_names'] = self.env['mail.channel'].browse(i['channel_ids']).mapped(
  13. lambda r: [r.id, '#' + r.display_name])
  14. return messages_values