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.

40 lines
1.1 KiB

  1. # Copyright (C) 2018 - TODAY, Pavlov Media
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import fields, models
  4. PROFILE_TYPE = [
  5. ('equipment', 'Equipment'),
  6. ('product', 'Product')
  7. ]
  8. class AgreementServiceProfile(models.Model):
  9. _name = 'agreement.serviceprofile'
  10. name = fields.Char(string="Name", required=True)
  11. profile_type = fields.Selection(
  12. PROFILE_TYPE,
  13. string="Profile Type")
  14. description = fields.Text(string="Description")
  15. equipment_id = fields.Many2one(
  16. 'maintenance.equipment',
  17. string="Equipment")
  18. product_id = fields.Many2one(
  19. 'product.product',
  20. string="Product",
  21. domain=[('serviceprofile_ok', '=', True)])
  22. equipment_category_id = fields.Many2one(
  23. 'maintenance.equipment.category',
  24. related='equipment_id.category_id',
  25. string="Equipment Category",
  26. readonly=1)
  27. agreement_id = fields.Many2one(
  28. 'agreement',
  29. string="Agreement",
  30. ondelete="cascade",
  31. required=True)
  32. fsm_location_id = fields.Many2one(
  33. 'fsm.location',
  34. string="Service Location")