[IMP] mis_builder: improve kpi _onchange_type
parent
46ec8fde20
commit
ce8eef95e3
|
@ -139,9 +139,14 @@ class MisReportKpi(models.Model):
|
||||||
|
|
||||||
@api.onchange('type')
|
@api.onchange('type')
|
||||||
def _onchange_type(self):
|
def _onchange_type(self):
|
||||||
# TODO: change compare_method, divider and dp for all 3 types
|
if self.type == 'num':
|
||||||
if self.type == 'pct':
|
self.compare_method = 'pct'
|
||||||
|
self.divider = '1'
|
||||||
|
self.dp = 0
|
||||||
|
elif self.type == 'pct':
|
||||||
self.compare_method = 'diff'
|
self.compare_method = 'diff'
|
||||||
|
self.divider = '1'
|
||||||
|
self.dp = 0
|
||||||
elif self.type == 'str':
|
elif self.type == 'str':
|
||||||
self.compare_method = 'none'
|
self.compare_method = 'none'
|
||||||
self.divider = ''
|
self.divider = ''
|
||||||
|
|
Loading…
Reference in New Issue