From 8bf890a9d6fc476da4d6c84fecdad5965ee41633 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Wed, 5 Jan 2011 16:17:01 +0530 Subject: [PATCH] [FIX] account_followup: raise an error when no sender email specified bzr revid: psi@tinyerp.co.in-20110105104701-u51jjbdrsvgpttvl --- addons/account_followup/wizard/account_followup_print.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index 922e7358700..5d9c2da860f 100755 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -275,8 +275,11 @@ class account_followup_print_all(osv.osv_memory): sub = tools.ustr(data['email_subject']) msg = '' if dest: - tools.email_send(src,dest,sub,body) - msg_sent += partner.name + '\n' + try: + tools.email_send(src, dest, sub, body) + msg_sent += partner.name + '\n' + except Exception, e: + raise osv.except_osv('Error !', e ) else: msg += partner.name + '\n' msg_unsent += msg @@ -301,7 +304,7 @@ class account_followup_print_all(osv.osv_memory): 'type': 'ir.actions.act_window', 'target': 'new', 'nodestroy': True - } + } def do_print(self, cr, uid, ids, context=None): if context is None: