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.

17 lines
595 B

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