From b4e1e32f0abb60f75b02be83e91bbcf32f3aa0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 21 Dec 2012 12:53:15 +0100 Subject: [PATCH] [FIX] portal: fixed various mail_mail records created without specifying the 'type' field; however this may conflict with the context holdign default_type (i.e. opportunity), leading to type values not in the selection field. bzr revid: tde@openerp.com-20121221115315-qni401mszwrkpvmj --- addons/portal/wizard/portal_wizard.py | 1 + addons/portal_sale/portal_sale.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index e88c68379ab..e3047cd5edb 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -212,6 +212,7 @@ class wizard_user(osv.osv_memory): 'subject': _(WELCOME_EMAIL_SUBJECT) % data, 'body_html': '
%s
' % (_(WELCOME_EMAIL_BODY) % data), 'state': 'outgoing', + 'type': 'email', } mail_id = mail_mail.create(cr, uid, mail_values, context=this_context) return mail_mail.send(cr, uid, [mail_id], context=this_context) diff --git a/addons/portal_sale/portal_sale.py b/addons/portal_sale/portal_sale.py index 3556fd5ca0e..d4d5b64cea3 100644 --- a/addons/portal_sale/portal_sale.py +++ b/addons/portal_sale/portal_sale.py @@ -68,6 +68,7 @@ class sale_order(osv.Model): 'subject': 'Invitation to follow %s' % document.name_get()[0][1], 'body_html': 'You have been invited to follow %s' % document.name_get()[0][1], 'auto_delete': True, + 'type': 'email', } mail_obj = self.pool.get('mail.mail') mail_id = mail_obj.create(cr, uid, mail_values, context=context) @@ -128,6 +129,7 @@ class account_invoice(osv.Model): 'subject': 'Invitation to follow %s' % document.name_get()[0][1], 'body_html': 'You have been invited to follow %s' % document.name_get()[0][1], 'auto_delete': True, + 'type': 'email', } mail_obj = self.pool.get('mail.mail') mail_id = mail_obj.create(cr, uid, mail_values, context=context)