mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
Highlight invalid ranges
This commit is contained in:
committed by
flachica
parent
c025c00cac
commit
cd45a7ff91
@@ -92,10 +92,8 @@ class KPIThresholdRange(models.Model):
|
||||
'res.company', 'Company',
|
||||
default=lambda self: self.env.user.company_id.id)
|
||||
|
||||
|
||||
@api.multi
|
||||
def _compute_min_value(self):
|
||||
result = {}
|
||||
for obj in self:
|
||||
value = None
|
||||
error = None
|
||||
@@ -121,11 +119,9 @@ class KPIThresholdRange(models.Model):
|
||||
error = str(e)
|
||||
obj.min_value = value
|
||||
obj.min_error = error
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
def _compute_max_value(self):
|
||||
result = {}
|
||||
for obj in self:
|
||||
value = None
|
||||
error = None
|
||||
@@ -151,11 +147,9 @@ class KPIThresholdRange(models.Model):
|
||||
error = str(e)
|
||||
obj.max_value = value
|
||||
obj.max_error = error
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
def _compute_is_valid_range(self):
|
||||
result = {}
|
||||
for obj in self:
|
||||
if obj.min_error or obj.max_error:
|
||||
obj.valid = False
|
||||
@@ -170,5 +164,3 @@ class KPIThresholdRange(models.Model):
|
||||
else:
|
||||
obj.valid = True
|
||||
obj.invalid_message = ""
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user