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.

20 lines
656 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 api, models
  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"] = (
  12. self.env["mail.channel"]
  13. .browse(i["channel_ids"])
  14. .mapped(lambda r: [r.id, "#" + r.display_name])
  15. )
  16. return messages_values