From 152add76f9605c577ede86a0d8a675b88532483d Mon Sep 17 00:00:00 2001 From: Matthieu Dietrich Date: Thu, 8 Jan 2015 12:17:29 +0100 Subject: [PATCH] logger before message (to catch evental DB cursor issues) --- account_easy_reconcile/easy_reconcile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_easy_reconcile/easy_reconcile.py b/account_easy_reconcile/easy_reconcile.py index 04482992..89af1759 100644 --- a/account_easy_reconcile/easy_reconcile.py +++ b/account_easy_reconcile/easy_reconcile.py @@ -291,12 +291,12 @@ class AccountEasyReconcile(orm.Model): # In case of error, we log it in the mail thread, log the # stack trace and create an empty history line; otherwise, # the cron will just loop on this reconcile task. + _logger.exception("The reconcile task %s had an exception: %s", + rec.name, e.value) message = "There was an error during reconciliation : %s" \ % e.value self.message_post(cr, uid, rec.id, body=message, context=context) - _logger.exception("The reconcile task %s had an exception: %s", - rec.name, e.value) self.pool.get('easy.reconcile.history').create(new_cr, uid, { 'easy_reconcile_id': rec.id, 'date': fields.datetime.now(),