diff options
Diffstat (limited to 'addons/share')
| -rw-r--r-- | addons/share/__openerp__.py | 2 | ||||
| -rw-r--r-- | addons/share/wizard/share_wizard.py | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/addons/share/__openerp__.py b/addons/share/__openerp__.py index f83f69abd1e..52ffa165c14 100644 --- a/addons/share/__openerp__.py +++ b/addons/share/__openerp__.py @@ -23,7 +23,7 @@ { "name" : "Sharing Tools", "version" : "1.5", - "depends" : ["base"], + "depends" : ["base", "mail"], "author" : "OpenERP SA", "category": 'Tools', 'complexity': "easy", diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index eec8b440dfa..b15129fd1bc 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -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) |
