project_task.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # -*- coding: utf-8 -*-
  2. from openerp import api, models, fields
  3. class ProjectTask(models.Model):
  4. _inherit = 'project.task'
  5. higher = fields.Boolean('Superior')
  6. lower = fields.Boolean('Inferior')
  7. a1 = fields.Boolean('A1(0,5)')
  8. a2 = fields.Boolean('A2(0,8)')
  9. _defaults = {
  10. 'higher': True,
  11. 'a1': True,
  12. }
  13. @api.one
  14. @api.onchange('lower')
  15. def change_model_higher(self):
  16. self.higher = not self.lower
  17. @api.one
  18. @api.onchange('higher')
  19. def change_model_lower(self):
  20. self.lower = not self.higher
  21. @api.one
  22. @api.onchange('a2')
  23. def change_model_a1(self):
  24. self.a1 = not self.a2
  25. @api.one
  26. @api.onchange('a1')
  27. def change_model_a2(self):
  28. self.a2 = not self.a1
  29. phase_start = fields.Integer(
  30. string='Fase',
  31. )
  32. phase_end = fields.Integer(
  33. string='de'
  34. )
  35. aligner = fields.Selection(
  36. selection = [
  37. ('A1', 'Utilidad'),
  38. ('gross_amount', 'Monto Bruto'),
  39. ]
  40. )