From 3c50eb017a0a6667f70f6f3d32a6d067e609dd18 Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Fri, 22 Jun 2012 12:18:54 +0530 Subject: [IMP] set logging.getLogger(__name__) bzr revid: kjo@tinyerp.com-20120622064854-5f6fss55k7305e8q --- addons/mail/mail_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/mail/mail_message.py') diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index f86ae29c80f..e45d4f07807 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -36,7 +36,7 @@ from osv import fields from tools.translate import _ from openerp import SUPERUSER_ID -_logger = logging.getLogger('mail') +_logger = logging.getLogger(__name__) def format_date_tz(date, tz=None): if not date: -- cgit v1.2.3 From d9db3c44df2a183d5f9d9f34ba6f6e8d597e135f Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Mon, 25 Jun 2012 19:12:53 +0530 Subject: [REN] renamed e-mail, E-mail, E-Mail to email, Email bzr revid: jam@tinyerp.com-20120625134253-sebauihl53zctcu0 --- addons/mail/mail_message.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/mail/mail_message.py') diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index f86ae29c80f..6dbe72337fc 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -202,10 +202,10 @@ class mail_message(osv.osv): _columns = { 'type': fields.selection([ - ('email', 'e-mail'), + ('email', 'email'), ('comment', 'Comment'), ('notification', 'System notification'), - ], 'Type', help="Message type: e-mail for e-mail message, notification for system message, comment for other messages such as user replies"), + ], 'Type', help="Message type: email for email message, notification for system message, comment for other messages such as user replies"), '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'), @@ -228,7 +228,7 @@ class mail_message(osv.osv): } #------------------------------------------------------ - # E-Mail api + # Email api #------------------------------------------------------ def init(self, cr): -- cgit v1.2.3 From 507b43cedf52efae1ac058e27d2e017a5e7762b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 29 Jun 2012 17:27:58 +0200 Subject: [IMP] mail.message: can now have void subjects. Void subjects are not displayed in chatter/wall; this allows to have a more flexible way to display blog post, while avoiding to display unnecessary data for notifications or quick replies. This imply that a way to manually add a subject when posting a comment is required; this will be done in openchatter part3. bzr revid: tde@openerp.com-20120629152758-9t23sdvtpdd49yyd --- addons/mail/mail_message.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'addons/mail/mail_message.py') diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 1c1e980e3ed..301657ba4c2 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -96,11 +96,24 @@ class mail_message_common(osv.osv_memory): continue result[message.id] = self.pool.get(message.model).name_get(cr, uid, [message.res_id], context=context)[0][1] return result - + + def name_get(self, cr, uid, ids, context=None): + res = [] + for message in self.browse(cr, uid, ids, context=context): + name = '' + if message.subject: + name = '%s: ' % (message.subject) + if message.body_text: + name = '%s%s ' % (name, message.body_text[0:20]) + if message.date: + name = '%s(%s)' % (name, message.date) + res.append((message.id, name)) + return res + _name = 'mail.message.common' _rec_name = 'subject' _columns = { - 'subject': fields.char('Subject', size=512, required=True), + 'subject': fields.char('Subject', size=512), 'model': fields.char('Related Document Model', size=128, select=1), 'res_id': fields.integer('Related Document ID', select=1), 'record_name': fields.function(get_record_name, type='string', string='Message Record Name', -- cgit v1.2.3