diff options
| author | Raphael Collet <rco@openerp.com> | 2013-04-11 09:37:08 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2013-04-11 09:37:08 +0200 |
| commit | 894eeef8e0ff44b2bf0b276718e6f48a0a7c1ee6 (patch) | |
| tree | 4ae49603ad9be6364b2aee9c3134c2a71be294b8 /addons/mail/wizard/mail_compose_message.py | |
| parent | fb4b655139d5a00f605ea954dfee2df77e457778 (diff) | |
| parent | a0a9ae61e7e41607aa9f6c918f003fd5699ffa4c (diff) | |
[MERGE] from trunk
bzr revid: rco@openerp.com-20130411073708-gaxl2332umtedmg6
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index b259135b7b7..fea1840008c 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -175,11 +175,17 @@ class mail_compose_message(osv.TransientModel): :param int res_id: id of the document record this mail is related to """ doc_name_get = self.pool[model].name_get(cr, uid, [res_id], context=context) + record_name = False if doc_name_get: record_name = doc_name_get[0][1] - else: - record_name = False - return {'model': model, 'res_id': res_id, 'record_name': record_name} + values = { + 'model': model, + 'res_id': res_id, + 'record_name': record_name, + } + if record_name: + values['subject'] = 'Re: %s' % record_name + return values def get_message_data(self, cr, uid, message_id, context=None): """ Returns a defaults-like dict with initial values for the composition @@ -197,7 +203,7 @@ class mail_compose_message(osv.TransientModel): # create subject re_prefix = _('Re:') - reply_subject = tools.ustr(message_data.subject or '') + reply_subject = tools.ustr(message_data.subject or message_data.record_name or '') if not (reply_subject.startswith('Re:') or reply_subject.startswith(re_prefix)) and message_data.subject: reply_subject = "%s %s" % (re_prefix, reply_subject) # get partner_ids from original message |
