[IMP] mis_builder: improve kpi _onchange_type

pull/86/head
Stéphane Bidoul 2015-06-07 17:10:08 +02:00
parent 46ec8fde20
commit ce8eef95e3
1 changed files with 7 additions and 2 deletions

View File

@ -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 = ''