diff --git a/scheduler_error_mailer/ir_cron.py b/scheduler_error_mailer/ir_cron.py index 548728bf4..4baa204b4 100644 --- a/scheduler_error_mailer/ir_cron.py +++ b/scheduler_error_mailer/ir_cron.py @@ -21,11 +21,12 @@ # along with this program. If not, see . # ############################################################################## - +import logging +import sys +import traceback from openerp import SUPERUSER_ID from openerp.osv import orm, fields from openerp.tools.translate import _ -import logging _logger = logging.getLogger(__name__) @@ -57,6 +58,9 @@ class ir_cron(orm.Model): context = { 'job_exception': job_exception, 'dbname': cr.dbname, + 'traceback': '\n'.join( + traceback.format_exception(*sys.exc_info()) + ), } _logger.debug("Sending scheduler error email with context=%s", diff --git a/scheduler_error_mailer/ir_cron_email_tpl.xml b/scheduler_error_mailer/ir_cron_email_tpl.xml index 859095b7c..22ef7a678 100644 --- a/scheduler_error_mailer/ir_cron_email_tpl.xml +++ b/scheduler_error_mailer/ir_cron_email_tpl.xml @@ -18,12 +18,16 @@ -

OpenERP tried to run the scheduler ${object.name or ''} in the database ${ctx.get('dbname')} but it failed. Here is the error message :

+

Odoo tried to run the scheduler ${object.name or ''} in the database ${ctx.get('dbname')} but it failed. Here is the error message :

-${ctx.get('job_exception') and ctx.get('job_exception').value or 'Failed to get the error message from the context.'} +${ctx.get('job_exception') and ctx.get('job_exception').value or ctx.get('job_exception') or 'Failed to get the error message from the context.'|e} +
+${ctx.get('traceback')|e}
+
+

You may check the logs of the Odoo server to get more information about this failure.

Properties of the scheduler ${object.name or ''} :