|
@ -183,10 +183,10 @@ class mis_report_kpi(orm.Model): |
|
|
if value is None or base_value is None: |
|
|
if value is None or base_value is None: |
|
|
return '' |
|
|
return '' |
|
|
if kpi.type == 'pct': |
|
|
if kpi.type == 'pct': |
|
|
return self._render_num(cr, uid, lang_id, |
|
|
|
|
|
|
|
|
return self._render_num( |
|
|
|
|
|
cr, uid, lang_id, |
|
|
value - base_value, |
|
|
value - base_value, |
|
|
0.01, kpi.dp, |
|
|
|
|
|
_('pp'), sign='+', |
|
|
|
|
|
|
|
|
0.01, kpi.dp, _('pp'), sign='+', |
|
|
context=context) |
|
|
context=context) |
|
|
elif kpi.type == 'num': |
|
|
elif kpi.type == 'num': |
|
|
if average_value: |
|
|
if average_value: |
|
@ -194,17 +194,17 @@ class mis_report_kpi(orm.Model): |
|
|
if average_base_value: |
|
|
if average_base_value: |
|
|
base_value = base_value / float(average_base_value) |
|
|
base_value = base_value / float(average_base_value) |
|
|
if kpi.compare_method == 'diff': |
|
|
if kpi.compare_method == 'diff': |
|
|
return self._render_num(cr, uid, lang_id, |
|
|
|
|
|
|
|
|
return self._render_num( |
|
|
|
|
|
cr, uid, lang_id, |
|
|
value - base_value, |
|
|
value - base_value, |
|
|
kpi.divider, kpi.dp, |
|
|
|
|
|
kpi.suffix, sign='+', |
|
|
|
|
|
|
|
|
kpi.divider, kpi.dp, kpi.suffix, sign='+', |
|
|
context=context) |
|
|
context=context) |
|
|
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) / abs(base_value), |
|
|
(value - base_value) / abs(base_value), |
|
|
0.01, kpi.dp, |
|
|
|
|
|
'%', sign='+', |
|
|
|
|
|
|
|
|
0.01, kpi.dp, '%', sign='+', |
|
|
context=context) |
|
|
context=context) |
|
|
return '' |
|
|
return '' |
|
|
|
|
|
|
|
|