Browse Source

Merge pull request #157 from acsone/7.0-mis_builder_compute_queue-lga

[7.0] mis_builder : in compute do not set val in localdict if there was a computation error
pull/171/head
Stéphane Bidoul (ACSONE) 9 years ago
parent
commit
764ffb01a0
  1. 2
      mis_builder/models/mis_builder.py

2
mis_builder/models/mis_builder.py

@ -651,6 +651,7 @@ class MisReportInstancePeriod(orm.Model):
kpi_val_comment = kpi.name + " = " + kpi.expression kpi_val_comment = kpi.name + " = " + kpi.expression
kpi_eval_expression = aep.replace_expr(kpi.expression) kpi_eval_expression = aep.replace_expr(kpi.expression)
kpi_val = safe_eval(kpi_eval_expression, localdict) kpi_val = safe_eval(kpi_eval_expression, localdict)
localdict[kpi.name] = kpi_val
except ZeroDivisionError: except ZeroDivisionError:
kpi_val = None kpi_val = None
kpi_val_rendered = '#DIV/0' kpi_val_rendered = '#DIV/0'
@ -668,7 +669,6 @@ class MisReportInstancePeriod(orm.Model):
kpi_val_rendered = kpi_obj.render( kpi_val_rendered = kpi_obj.render(
cr, uid, lang_id, kpi, kpi_val, context=context) cr, uid, lang_id, kpi, kpi_val, context=context)
localdict[kpi.name] = kpi_val
try: try:
kpi_style = None kpi_style = None
if kpi.css_style: if kpi.css_style:

Loading…
Cancel
Save