create kpi history as sudo

This commit is contained in:
Jordi Ballester Alomar
2019-01-01 22:55:03 +01:00
committed by flachica
parent 488d85eb90
commit a9a03359a0

View File

@@ -158,7 +158,7 @@ class KPI(models.Model):
for obj in self:
history_vals = obj._get_kpi_value()
history_obj = self.env['kpi.history']
history_obj.create(history_vals)
history_obj.sudo().create(history_vals)
return True
@api.multi