You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
968 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2012 - Now Savoir-faire Linux <https://www.savoirfairelinux.com/>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp import fields, models
  5. class KPIHistory(models.Model):
  6. """History of the KPI."""
  7. _name = "kpi.history"
  8. _description = "History of the KPI"
  9. _order = "date desc"
  10. name = fields.Char('Name', size=150, required=True,
  11. default=fields.Datetime.now(),)
  12. kpi_id = fields.Many2one('kpi', 'KPI', required=True)
  13. date = fields.Datetime(
  14. 'Execution Date',
  15. required=True,
  16. readonly=True,
  17. default=fields.Datetime.now()
  18. )
  19. value = fields.Float('Value', required=True, readonly=True)
  20. color = fields.Text('Color', required=True,
  21. readonly=True, default='#FFFFFF')
  22. company_id = fields.Many2one(
  23. 'res.company', 'Company',
  24. default=lambda self: self.env.user.company_id.id)