Browse Source

add periodicity in minutes

pull/267/head
Jordi Ballester Alomar 6 years ago
committed by Adrià Gil Sorribes
parent
commit
4ba6b2e75f
  1. 3
      kpi/models/kpi.py

3
kpi/models/kpi.py

@ -62,6 +62,7 @@ class KPI(models.Model):
periodicity = fields.Integer('Periodicity', default=1)
periodicity_uom = fields.Selection((
('minute', 'Minute'),
('hour', 'Hour'),
('day', 'Day'),
('week', 'Week'),
@ -165,6 +166,8 @@ class KPI(models.Model):
for obj in self:
if obj.periodicity_uom == 'hour':
delta = relativedelta(hours=obj.periodicity)
elif obj.periodicity_uom == 'minute':
delta = relativedelta(minutes=obj.periodicity)
elif obj.periodicity_uom == 'day':
delta = relativedelta(days=obj.periodicity)
elif obj.periodicity_uom == 'week':

Loading…
Cancel
Save