Browse Source

[IMP] mis_builder: improve kpi _onchange_type

pull/90/head
Stéphane Bidoul 10 years ago
parent
commit
826b831433
  1. 9
      mis_builder/models/mis_builder.py

9
mis_builder/models/mis_builder.py

@ -139,9 +139,14 @@ class MisReportKpi(models.Model):
@api.onchange('type')
def _onchange_type(self):
# TODO: change compare_method, divider and dp for all 3 types
if self.type == 'pct':
if self.type == 'num':
self.compare_method = 'pct'
self.divider = '1'
self.dp = 0
elif self.type == 'pct':
self.compare_method = 'diff'
self.divider = '1'
self.dp = 0
elif self.type == 'str':
self.compare_method = 'none'
self.divider = ''

Loading…
Cancel
Save