From 09ec9d706d1ade5054e53624202dc58c96df791b Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 11 Jul 2014 17:35:56 +0200 Subject: [PATCH] [PEP8] scheduler_error_mailer --- scheduler_error_mailer/ir_cron.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scheduler_error_mailer/ir_cron.py b/scheduler_error_mailer/ir_cron.py index 80b427c31..8971da486 100644 --- a/scheduler_error_mailer/ir_cron.py +++ b/scheduler_error_mailer/ir_cron.py @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -################################################################################# +############################################################################## # # Scheduler Error Mailer module for OpenERP # Copyright (C) 2012-2013 Akretion (http://www.akretion.com/) @@ -28,20 +28,21 @@ import logging logger = logging.getLogger(__name__) + class ir_cron(orm.Model): _inherit = "ir.cron" _columns = { - 'email_template': fields.many2one('email.template', + 'email_template': fields.many2one( + 'email.template', 'Error E-mail Template', help="Select the email template that will be sent when this scheduler fails."), } - def _handle_callback_exception(self, cr, uid, model_name, method_name, args, job_id, job_exception): - res = super(ir_cron, self)._handle_callback_exception(cr, uid, - model_name, method_name, args, job_id, job_exception) + res = super(ir_cron, self)._handle_callback_exception( + cr, uid, model_name, method_name, args, job_id, job_exception) my_cron = self.browse(cr, uid, job_id) @@ -54,9 +55,9 @@ class ir_cron(orm.Model): } logger.debug("Sending scheduler error email with context=%s" % context) - self.pool['email.template'].send_mail(cr, uid, - my_cron.email_template.id, my_cron.id, force_send=True, - context=context) + self.pool['email.template'].send_mail( + cr, uid, my_cron.email_template.id, my_cron.id, + force_send=True, context=context) return res @@ -67,4 +68,3 @@ class res_users(orm.Model): def test_scheduler_failure(self, cr, uid, context=None): """This function is used to test and debug this module""" raise orm.except_orm(_('Error :'), _("Task failure with UID = %d." % uid)) -