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.

25 lines
743 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from openerp import models
  5. from openerp import api
  6. TIMELINE_VIEW = ('timeline', 'Timeline')
  7. class IrUIView(models.Model):
  8. _inherit = 'ir.ui.view'
  9. @api.model
  10. def _setup_fields(self):
  11. """Hack due since the field 'type' is not defined with the new api.
  12. """
  13. cls = type(self)
  14. type_selection = cls._fields['type'].selection
  15. if TIMELINE_VIEW not in type_selection:
  16. tmp = list(type_selection)
  17. tmp.append(TIMELINE_VIEW)
  18. cls._fields['type'].selection = tuple(set(tmp))
  19. super(IrUIView, self)._setup_fields()