diff --git a/agreement_maintenance/__init__.py b/agreement_maintenance/__init__.py index 073035d1..f81bdaa9 100644 --- a/agreement_maintenance/__init__.py +++ b/agreement_maintenance/__init__.py @@ -1,4 +1,5 @@ -# Copyright (C) 2018 - TODAY, Pavlov Media +# Copyright (C) 2018 Pavlov Media +# Copyright (C) 2019 Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/agreement_maintenance/__manifest__.py b/agreement_maintenance/__manifest__.py index b62ede72..ded8960c 100644 --- a/agreement_maintenance/__manifest__.py +++ b/agreement_maintenance/__manifest__.py @@ -1,4 +1,5 @@ -# Copyright (C) 2018 - TODAY, Pavlov Media +# Copyright (C) 2018 Pavlov Media +# Copyright (C) 2019 Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { @@ -10,14 +11,16 @@ 'website': 'https://github.com/OCA/contract', 'category': 'Maintenance', 'license': 'AGPL-3', - 'version': '12.0.1.0.0', + 'version': '12.0.1.1.0', 'depends': [ 'maintenance', 'agreement_serviceprofile', ], 'data': [ 'views/agreement_view.xml', + 'views/agreement_serviceprofile_view.xml', 'views/maintenance_request_view.xml', + 'views/maintenance_equipment_view.xml', ], 'development_status': 'Beta', 'maintainers': ['max3903'], diff --git a/agreement_maintenance/models/__init__.py b/agreement_maintenance/models/__init__.py index bbfee333..2f770663 100644 --- a/agreement_maintenance/models/__init__.py +++ b/agreement_maintenance/models/__init__.py @@ -2,5 +2,7 @@ from . import ( agreement, + agreement_serviceprofile, maintenance_request, + maintenance_equipment, ) diff --git a/agreement_maintenance/models/agreement_serviceprofile.py b/agreement_maintenance/models/agreement_serviceprofile.py new file mode 100644 index 00000000..a3229fbd --- /dev/null +++ b/agreement_maintenance/models/agreement_serviceprofile.py @@ -0,0 +1,11 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class AgreementServiceProfile(models.Model): + _inherit = "agreement.serviceprofile" + + equipment_id = fields.Many2one('maintenance.equipment', + string='Equipment') diff --git a/agreement_maintenance/models/maintenance_equipment.py b/agreement_maintenance/models/maintenance_equipment.py new file mode 100644 index 00000000..32963f0f --- /dev/null +++ b/agreement_maintenance/models/maintenance_equipment.py @@ -0,0 +1,12 @@ +# Copyright (C) 2019 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MaintenanceEquipment(models.Model): + _inherit = 'maintenance.equipment' + + agreement_id = fields.Many2one('agreement', string='Agreement') + serviceprofile_ids = fields.One2many( + 'agreement.serviceprofile', 'equipment_id', string='Service Profiles') diff --git a/agreement_maintenance/views/agreement_serviceprofile_view.xml b/agreement_maintenance/views/agreement_serviceprofile_view.xml new file mode 100644 index 00000000..9f989955 --- /dev/null +++ b/agreement_maintenance/views/agreement_serviceprofile_view.xml @@ -0,0 +1,17 @@ + + + + + agreement.serviceprofile.form.equipment + agreement.serviceprofile + + + + + + + + + diff --git a/agreement_maintenance/views/agreement_view.xml b/agreement_maintenance/views/agreement_view.xml index 9cce2735..7037fe0f 100644 --- a/agreement_maintenance/views/agreement_view.xml +++ b/agreement_maintenance/views/agreement_view.xml @@ -1,9 +1,11 @@ - + - Maaintenance Requests + Maintenance Requests ir.actions.act_window maintenance.request form diff --git a/agreement_maintenance/views/maintenance_equipment_view.xml b/agreement_maintenance/views/maintenance_equipment_view.xml new file mode 100644 index 00000000..fe5c76ae --- /dev/null +++ b/agreement_maintenance/views/maintenance_equipment_view.xml @@ -0,0 +1,47 @@ + + + + + maintenance.equipment.form.agreement + maintenance.equipment + + + + + + + + + + + + + + + + + + + + + + + maintenance.equipment.select.agreement + maintenance.equipment + + + + + + + + + diff --git a/agreement_maintenance/views/maintenance_request_view.xml b/agreement_maintenance/views/maintenance_request_view.xml index 8e8aa3fa..05922ef6 100644 --- a/agreement_maintenance/views/maintenance_request_view.xml +++ b/agreement_maintenance/views/maintenance_request_view.xml @@ -1,4 +1,6 @@ - +