From 65241d6dea1af8c44ab4ef92696579c1c679efd2 Mon Sep 17 00:00:00 2001 From: David Beal Date: Thu, 24 Oct 2019 10:28:33 +0200 Subject: [PATCH] ADD module mrp_component_consumption_gap --- sql_request_abstract/models/sql_request_mixin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql_request_abstract/models/sql_request_mixin.py b/sql_request_abstract/models/sql_request_mixin.py index cd2010355..36a7083c3 100644 --- a/sql_request_abstract/models/sql_request_mixin.py +++ b/sql_request_abstract/models/sql_request_mixin.py @@ -5,6 +5,7 @@ import re import uuid +import logging from io import BytesIO import base64 from psycopg2 import ProgrammingError @@ -12,6 +13,8 @@ from psycopg2 import ProgrammingError from odoo import _, api, fields, models from odoo.exceptions import UserError +logger = logging.getLogger(__name__) + class SQLRequestMixin(models.AbstractModel): _name = 'sql.request.mixin' @@ -242,6 +245,7 @@ class SQLRequestMixin(models.AbstractModel): self.env.cr.execute(query) res = self._hook_executed_request() except ProgrammingError as e: + logger.exception("Failed query: %s", query) raise UserError( _("The SQL query is not valid:\n\n %s") % e) finally: