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