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

Loading…
Cancel
Save