Browse Source

[FIX] fix operation on SimpleArray

pull/189/head
Sébastien BEAU 9 years ago
committed by Stéphane Bidoul
parent
commit
3487411a5e
  1. 10
      mis_builder/models/mis_builder.py

10
mis_builder/models/mis_builder.py

@ -298,6 +298,7 @@ class MisReportSubkpi(models.Model):
name = fields.Char(required=True) name = fields.Char(required=True)
expression_ids = fields.One2many('mis.report.kpi.expression', 'subkpi_id') expression_ids = fields.One2many('mis.report.kpi.expression', 'subkpi_id')
@api.multi
def unlink(self): def unlink(self):
for subkpi in self: for subkpi in self:
subkpi.expression_ids.unlink() subkpi.expression_ids.unlink()
@ -569,6 +570,9 @@ class MisReport(models.Model):
if kpi.multi: if kpi.multi:
vals = SimpleArray(vals) vals = SimpleArray(vals)
else:
vals = vals[0]
localdict[kpi.name] = vals localdict[kpi.name] = vals
res[kpi] = vals res[kpi] = vals
@ -788,7 +792,11 @@ class MisReportInstancePeriod(models.Model):
else: else:
drilldown = (subkpi_val is not None and drilldown = (subkpi_val is not None and
AEP.has_account_var(kpi.expression)) AEP.has_account_var(kpi.expression))
comment = kpi.name + " = " + kpi.expression_ids[idx].name
if kpi.multi:
expression = kpi.expression_ids[idx].name
else:
expression = kpi.expression
comment = kpi.name + " = " + expression
vals.update({ vals.update({
'val': None if subkpi_val is AccountingNone 'val': None if subkpi_val is AccountingNone
else subkpi_val, else subkpi_val,

Loading…
Cancel
Save