From eaf07ae5c45be7ee3e55bf405556aa50d8a59091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 28 Aug 2013 16:08:45 +0200 Subject: [PATCH] [FIX] mail_message: fixed reply_to and email_from computation in create: take also False values, only undefined values trigger the default one bzr revid: tde@openerp.com-20130828140845-uuv8ouoto4q7g96j --- addons/mail/mail_message.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index e3a1ae93342..ef3b70bed13 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -91,6 +91,7 @@ class mail_message(osv.Model): SUPERUSER_ID, to be sure to have the record name correctly stored. """ # TDE note: regroup by model/ids, to have less queries to perform result = dict.fromkeys(ids, False) + # return result for message in self.read(cr, uid, ids, ['model', 'res_id'], context=context): if not message.get('model') or not message.get('res_id') or message['model'] not in self.pool: continue @@ -830,11 +831,11 @@ class mail_message(osv.Model): context = {} default_starred = context.pop('default_starred', False) - if not values.get('email_from'): # needed to compute reply_to + if 'email_from' not in values: # needed to compute reply_to values['email_from'] = self._get_default_from(cr, uid, context=context) if not values.get('message_id'): values['message_id'] = self._get_message_id(cr, uid, values, context=context) - if not values.get('reply_to'): + if 'reply_to' not in values: values['reply_to'] = self._get_reply_to(cr, uid, values, context=context) newid = super(mail_message, self).create(cr, uid, values, context)