[iMP] kpi_dashboard: pylint fix
parent
b376049f77
commit
e091cd5854
|
@ -1,10 +1,13 @@
|
||||||
# Copyright 2020 Creu Blanca
|
# Copyright 2020 Creu Blanca
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
import logging
|
||||||
|
|
||||||
from odoo import _, api, fields, models
|
from odoo import _, api, fields, models
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.tools.safe_eval import safe_eval
|
from odoo.tools.safe_eval import safe_eval
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class KpiDashboard(models.Model):
|
class KpiDashboard(models.Model):
|
||||||
|
|
||||||
|
@ -204,8 +207,8 @@ class KpiDashboardItem(models.Model):
|
||||||
ctx = safe_eval(self.special_context)
|
ctx = safe_eval(self.special_context)
|
||||||
if isinstance(ctx, dict):
|
if isinstance(ctx, dict):
|
||||||
kpi = kpi.with_context(**ctx)
|
kpi = kpi.with_context(**ctx)
|
||||||
except SyntaxError:
|
except SyntaxError as e:
|
||||||
pass
|
_logger.info(e)
|
||||||
vals.update(
|
vals.update(
|
||||||
{
|
{
|
||||||
"value": kpi._compute_value(),
|
"value": kpi._compute_value(),
|
||||||
|
|
Loading…
Reference in New Issue