From 3b4740d3969354d53d9fd53fa683c7a6a51b1648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 7 Jun 2015 17:12:57 +0200 Subject: [PATCH] [IMP] mis_builder: log conditional style evaluation errors --- mis_builder/models/mis_builder.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mis_builder/models/mis_builder.py b/mis_builder/models/mis_builder.py index f15e71d9..44a3dd62 100644 --- a/mis_builder/models/mis_builder.py +++ b/mis_builder/models/mis_builder.py @@ -23,6 +23,7 @@ ############################################################################## from datetime import datetime, timedelta +import logging import re import traceback @@ -33,6 +34,8 @@ from openerp.tools.safe_eval import safe_eval from .aep import AccountingExpressionProcessor as AEP +_logger = logging.getLogger(__name__) + class AutoStruct(object): @@ -515,7 +518,8 @@ class MisReportInstancePeriod(models.Model): if kpi.css_style: kpi_style = safe_eval(kpi.css_style, localdict) except: - # TODO: log warning + _logger.warning("error evaluating css stype expression %s", + kpi.css_style, exc_info=True) kpi_style = None drilldown = (kpi_val is not None and