Files
odoo_source/addons/portal/models/mail_message.py
T
Jérome Maes fe5fa6973c [IMP] http_routing: use converter defined in the module
Otherwise, the slug part of route can be used only when website is installed.
2017-08-16 14:56:43 +02:00

24 lines
805 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class MailMessage(models.Model):
_inherit = 'mail.message'
@api.multi
def portal_message_format(self):
return self._portal_message_format([
'id', 'body', 'date', 'author_id', 'email_from', # base message fields
'message_type', 'subtype_id', 'subject', # message specific
'model', 'res_id', 'record_name', # document related
])
@api.multi
def _portal_message_format(self, fields_list):
message_values = self.read(fields_list)
message_tree = dict((m.id, m) for m in self.sudo())
self._message_read_dict_postprocess(message_values, message_tree)
return message_values