From 49aa3217931f806a89ffd7dfda05e356e15fd507 Mon Sep 17 00:00:00 2001 From: "Guewen Baconnier @ Camptocamp" Date: Mon, 29 Oct 2012 15:44:24 +0100 Subject: [PATCH] [IMP] removed the catch around the generation of the mail template, we do not want to catch coding errors and anyway the errors in the rendering are already trapped (lp:c2c-addons/6.1 rev 89.1.43) --- .../wizard/credit_control_communication.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/account_credit_control/wizard/credit_control_communication.py b/account_credit_control/wizard/credit_control_communication.py index 4f292df12..0dcd59239 100644 --- a/account_credit_control/wizard/credit_control_communication.py +++ b/account_credit_control/wizard/credit_control_communication.py @@ -141,20 +141,10 @@ class CreditCommunication(TransientModel): template = comm.current_policy_level.mail_template_id.id mail_values = {} cl_ids = [cl.id for cl in comm.credit_control_line_ids] - try: - mail_values = mail_temp_obj.generate_email(cr, uid, - template, - comm.id, - context=context) - # can we restrict this too wide exception ? - # or even let it break the system ? It seems that this is a coding - # or template error if we have an exception, it should be handled - # by a developer - except Exception, exc: - logger.warning("Failed to generate e-mail for credit control line with ids: %s", - cl_ids, exc_info=True) - cr_line_obj.write(cr, uid, cl_ids, {'state': 'mail_error'}, context=context) - continue + mail_values = mail_temp_obj.generate_email(cr, uid, + template, + comm.id, + context=context) mail_id = mail_message_obj.create(cr, uid, mail_values, context=context)