2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-01-16 11:34:37 +01:00
|
|
|
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
2018-01-16 06:58:15 +01:00
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra import api, models
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
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
|