summaryrefslogtreecommitdiff
path: root/addons/share/wizard
diff options
context:
space:
mode:
authorBharat (OpenERP) <bde@tinyerp.com>2011-09-15 17:02:01 +0530
committerBharat (OpenERP) <bde@tinyerp.com>2011-09-15 17:02:01 +0530
commitd72be842e320dfff08b7ad4b443740060dfd5a4e (patch)
treefd8315220318e2abd672b4270a18a763c8564e9d /addons/share/wizard
parent1e767f0d14dfb0870767524bf16c9909bcaee995 (diff)
parentfbf6708d1041f84018bb9c13e997b705e6086648 (diff)
[MERGE] merged with main addons
bzr revid: bde@tinyerp.com-20110915113201-fgbs2d2qr45ljmsg
Diffstat (limited to 'addons/share/wizard')
-rw-r--r--addons/share/wizard/share_wizard.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py
index eec8b440dfa..b66ccc2dd47 100644
--- a/addons/share/wizard/share_wizard.py
+++ b/addons/share/wizard/share_wizard.py
@@ -211,7 +211,7 @@ class share_wizard(osv.osv_memory):
del new_context[key]
dataobj = self.pool.get('ir.model.data')
- menu_id = dataobj._get_id(cr, uid, 'base', 'menu_administration_shortcut', new_context)
+ menu_id = dataobj._get_id(cr, uid, 'base', 'menu_administration_shortcut')
shortcut_menu_id = int(dataobj.read(cr, uid, menu_id, ['res_id'], new_context)['res_id'])
action_id = self.pool.get('ir.actions.act_window').create(cr, UID_ROOT, values, new_context)
menu_data = {'name': values['name'],
@@ -692,6 +692,7 @@ class share_wizard(osv.osv_memory):
def send_emails(self, cr, uid, wizard_data, context=None):
self._logger.info('Sending share notifications by email...')
+ mail_message = self.pool.get('mail.message')
user = self.pool.get('res.users').browse(cr, UID_ROOT, uid)
if not user.user_email:
raise osv.except_osv(_('Email required'), _('The current user must have an email address configured in User Preferences to be able to send outgoing emails.'))
@@ -726,7 +727,12 @@ class share_wizard(osv.osv_memory):
body += _("OpenERP is a powerful and user-friendly suite of Business Applications (CRM, Sales, HR, etc.)\n"
"It is open source and can be found on http://www.openerp.com.")
- if tools.email_send(user.user_email, [email_to], subject, body):
+ if mail_message.schedule_with_attach(cr, uid,
+ user.user_email,
+ [email_to],
+ subject,
+ body,
+ model='share.wizard'):
emails_sent += 1
else:
self._logger.warning('Failed to send share notification from %s to %s, ignored', user.user_email, email_to)