Browse Source

[FIX] mis_builder: percentage comparison in presence of negative values

pull/90/head
Stéphane Bidoul 10 years ago
parent
commit
af172d8087
  1. 2
      mis_builder/models/mis_builder.py

2
mis_builder/models/mis_builder.py

@ -202,7 +202,7 @@ class mis_report_kpi(orm.Model):
elif kpi.compare_method == 'pct': elif kpi.compare_method == 'pct':
if round(base_value, kpi.dp) != 0: if round(base_value, kpi.dp) != 0:
return self._render_num(cr, uid, lang_id, return self._render_num(cr, uid, lang_id,
value / base_value - 1,
(value - base_value) / abs(base_value),
0.01, kpi.dp, 0.01, kpi.dp,
'%', sign='+', '%', sign='+',
context=context) context=context)

Loading…
Cancel
Save