|
@ -236,7 +236,6 @@ class KpiMatrix(object): |
|
|
if isinstance(val, DataError): |
|
|
if isinstance(val, DataError): |
|
|
val_rendered = val.name |
|
|
val_rendered = val.name |
|
|
val_comment = val.msg |
|
|
val_comment = val.msg |
|
|
val = None |
|
|
|
|
|
else: |
|
|
else: |
|
|
val_rendered = self._style_model.render( |
|
|
val_rendered = self._style_model.render( |
|
|
self.lang, row.style_props, kpi.type, val) |
|
|
self.lang, row.style_props, kpi.type, val) |
|
@ -401,9 +400,13 @@ class KpiMatrix(object): |
|
|
# TODO use subcol style here |
|
|
# TODO use subcol style here |
|
|
row_data['cells'].append({}) |
|
|
row_data['cells'].append({}) |
|
|
else: |
|
|
else: |
|
|
|
|
|
if cell.val is AccountingNone or \ |
|
|
|
|
|
isinstance(cell.val, DataError): |
|
|
|
|
|
val = None |
|
|
|
|
|
else: |
|
|
|
|
|
val = cell.val |
|
|
col_data = { |
|
|
col_data = { |
|
|
'val': (cell.val |
|
|
|
|
|
if cell.val is not AccountingNone else None), |
|
|
|
|
|
|
|
|
'val': val, |
|
|
'val_r': cell.val_rendered, |
|
|
'val_r': cell.val_rendered, |
|
|
'val_c': cell.val_comment, |
|
|
'val_c': cell.val_comment, |
|
|
'style': self._style_model.to_css_style( |
|
|
'style': self._style_model.to_css_style( |
|
@ -967,15 +970,15 @@ class MisReport(models.Model): |
|
|
if isinstance(vals[0], tuple): |
|
|
if isinstance(vals[0], tuple): |
|
|
vals = vals[0] |
|
|
vals = vals[0] |
|
|
assert len(vals) == col.colspan |
|
|
assert len(vals) == col.colspan |
|
|
elif isinstance(vals[0], NameDataError): |
|
|
|
|
|
|
|
|
elif isinstance(vals[0], DataError): |
|
|
vals = (vals[0],) * col.colspan |
|
|
vals = (vals[0],) * col.colspan |
|
|
else: |
|
|
else: |
|
|
raise UserError("Probably not your fault... but I'm " |
|
|
raise UserError("Probably not your fault... but I'm " |
|
|
"really curious to know how you " |
|
|
"really curious to know how you " |
|
|
"managed to raise this error so " |
|
|
"managed to raise this error so " |
|
|
"I can handle one more corner case!") |
|
|
"I can handle one more corner case!") |
|
|
if len(drilldown_args) != len(vals): |
|
|
|
|
|
drilldown_args = [None] * len(vals) |
|
|
|
|
|
|
|
|
if len(drilldown_args) != col.colspan: |
|
|
|
|
|
drilldown_args = [None] * col.colspan |
|
|
kpi_matrix.set_values( |
|
|
kpi_matrix.set_values( |
|
|
kpi, col_key, vals, drilldown_args) |
|
|
kpi, col_key, vals, drilldown_args) |
|
|
|
|
|
|
|
|