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.

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