From a6fd78b0a0d8d2d5e6179f27fcaec656230b05be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 11 May 2012 12:37:42 +0200 Subject: [PATCH] [REM] mail.message: removed display_text field, that was used only in Communication History. bzr revid: tde@openerp.com-20120511103742-xld31z7kic72wvib --- addons/mail/mail_message.py | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 80288bd8bda..ae28e0e89bf 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -75,8 +75,9 @@ class mail_message_common(osv.TransientModel): emails should inherit from this class and not from mail.message.""" def get_body(self, cr, uid, ids, name, arg, context=None): - if context is None: - context = {} + """ get correct body version: body_html for html messages, and + body_text for plain text messages + """ result = dict.fromkeys(ids, '') for message in self.browse(cr, uid, ids, context=context): if message.content_subtype == 'html': @@ -186,25 +187,6 @@ class mail_message(osv.Model): 'nodestroy': True }) return action_data - - def _get_display_text(self, cr, uid, ids, name, arg, context=None): - if context is None: - context = {} - tz = context.get('tz') - result = {} - - # Read message as UID 1 to allow viewing author even if from different company - for message in self.browse(cr, SUPERUSER_ID, ids): - msg_txt = '' - if message.email_from: - msg_txt += _('%s wrote on %s: \n Subject: %s \n\t') % (message.email_from or '/', format_date_tz(message.date, tz), message.subject) - if message.body_text: - msg_txt += truncate_text(message.body_text) - else: - msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t' - msg_txt += (message.subject or '') - result[message.id] = msg_txt - return result _columns = { 'type': fields.selection([ @@ -220,7 +202,6 @@ class mail_message(osv.Model): 'partner_id': fields.many2one('res.partner', 'Related partner'), 'user_id': fields.many2one('res.users', 'Related user', readonly=1), 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'), - 'display_text': fields.function(_get_display_text, method=True, type='text', size="512", string='Display Text'), 'mail_server_id': fields.many2one('ir.mail_server', 'Outgoing mail server', readonly=1), 'state': fields.selection([ ('outgoing', 'Outgoing'),