|
@ -485,6 +485,7 @@ class MisReportInstancePeriod(models.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' |
|
@ -501,7 +502,6 @@ class MisReportInstancePeriod(models.Model): |
|
|
else: |
|
|
else: |
|
|
kpi_val_rendered = kpi.render(lang_id, kpi_val) |
|
|
kpi_val_rendered = kpi.render(lang_id, kpi_val) |
|
|
|
|
|
|
|
|
localdict[kpi.name] = kpi_val |
|
|
|
|
|
try: |
|
|
try: |
|
|
kpi_style = None |
|
|
kpi_style = None |
|
|
if kpi.css_style: |
|
|
if kpi.css_style: |
|
|