From 662bf81627e1b5e160462882b62f89b6950c8e8a Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Thu, 3 Nov 2011 12:05:21 +0530 Subject: [PATCH 1/2] [FIX]portal: send portal user mail bzr revid: kjo@tinyerp.com-20111103063521-330p40h60v76ub7n --- addons/portal/wizard/portal_wizard.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index b966abfef41..71be022f14e 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -23,7 +23,7 @@ import logging import random from osv import osv, fields -from tools.misc import email_re, email_send +from tools.misc import email_re from tools.translate import _ from base.res.res_users import _lang_get @@ -163,6 +163,7 @@ class wizard(osv.osv_memory): 'url': wiz.portal_id.url or _("(missing url)"), 'db': cr.dbname, } + mail_message_obj = self.pool.get('mail.message') dest_uids = user_obj.search(cr, ROOT_UID, login_cond) dest_users = user_obj.browse(cr, ROOT_UID, dest_uids) for dest_user in dest_users: @@ -175,7 +176,7 @@ class wizard(osv.osv_memory): email_to = dest_user.user_email subject = _(WELCOME_EMAIL_SUBJECT) % data body = _(WELCOME_EMAIL_BODY) % data - res = email_send(email_from, [email_to], subject, body) + res = mail_message_obj.schedule_with_attach(cr, uid, email_from , [email_to], subject, body, model=context.get('active_model'), res_id=u.partner_id.id, context=context) if not res: logging.getLogger('res.portal.wizard').warning( 'Failed to send email from %s to %s', email_from, email_to) From b672eee67c597445ed5000a431f948a887b3f3b4 Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Thu, 3 Nov 2011 12:21:44 +0530 Subject: [PATCH 2/2] [FIX]portal: remove unused parameter bzr revid: kjo@tinyerp.com-20111103065144-ii6ahohdkg877usj --- addons/portal/wizard/portal_wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 71be022f14e..7157f22f129 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -176,7 +176,7 @@ class wizard(osv.osv_memory): email_to = dest_user.user_email subject = _(WELCOME_EMAIL_SUBJECT) % data body = _(WELCOME_EMAIL_BODY) % data - res = mail_message_obj.schedule_with_attach(cr, uid, email_from , [email_to], subject, body, model=context.get('active_model'), res_id=u.partner_id.id, context=context) + res = mail_message_obj.schedule_with_attach(cr, uid, email_from , [email_to], subject, body, context=context) if not res: logging.getLogger('res.portal.wizard').warning( 'Failed to send email from %s to %s', email_from, email_to)