Browse Source

Fix some formatting.

pull/80/head
Jairo Llopis 10 years ago
parent
commit
d05b51f1ea
  1. 13
      scheduler_error_mailer/ir_cron.py

13
scheduler_error_mailer/ir_cron.py

@ -26,7 +26,8 @@ from openerp.osv import orm, fields
from openerp.tools.translate import _ from openerp.tools.translate import _
import logging import logging
logger = logging.getLogger(__name__)
_logger = logging.getLogger(__name__)
class ir_cron(orm.Model): class ir_cron(orm.Model):
@ -36,10 +37,12 @@ class ir_cron(orm.Model):
'email_template': fields.many2one( 'email_template': fields.many2one(
'email.template', 'email.template',
'Error E-mail Template', 'Error E-mail Template',
help="Select the email template that will be sent when this scheduler fails."),
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):
def _handle_callback_exception(self, cr, uid, model_name, method_name,
args, job_id, job_exception):
res = super(ir_cron, self)._handle_callback_exception( res = super(ir_cron, self)._handle_callback_exception(
cr, uid, model_name, method_name, args, job_id, job_exception) cr, uid, model_name, method_name, args, job_id, job_exception)
@ -54,7 +57,9 @@ class ir_cron(orm.Model):
'dbname': cr.dbname, 'dbname': cr.dbname,
} }
logger.debug("Sending scheduler error email with context=%s" % context)
_logger.debug("Sending scheduler error email with context=%s",
context)
self.pool['email.template'].send_mail( self.pool['email.template'].send_mail(
cr, uid, my_cron.email_template.id, my_cron.id, cr, uid, my_cron.email_template.id, my_cron.id,
force_send=True, context=context) force_send=True, context=context)

Loading…
Cancel
Save