From 297e031e0b5d8539b6ece5bc3d097cee2b8e6148 Mon Sep 17 00:00:00 2001 From: scampbell Date: Mon, 10 Jun 2019 12:33:51 -0700 Subject: [PATCH] [ADD] Notes to ServPro, add ServPro to Agreement [IMP] Flake8 [IMP] github changes [IMP] Placeholder in notes remove


--- agreement_serviceprofile/__manifest__.py | 1 + agreement_serviceprofile/models/__init__.py | 1 + agreement_serviceprofile/models/agreement.py | 12 ++++++++++ .../models/agreement_serviceprofile.py | 12 ++++++---- agreement_serviceprofile/views/agreement.xml | 24 +++++++++++++++++++ .../views/agreement_serviceprofile.xml | 3 +++ 6 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 agreement_serviceprofile/models/agreement.py create mode 100644 agreement_serviceprofile/views/agreement.xml diff --git a/agreement_serviceprofile/__manifest__.py b/agreement_serviceprofile/__manifest__.py index c0a20239..58748f12 100644 --- a/agreement_serviceprofile/__manifest__.py +++ b/agreement_serviceprofile/__manifest__.py @@ -15,6 +15,7 @@ 'data': [ 'security/ir.model.access.csv', 'views/agreement_serviceprofile.xml', + 'views/agreement.xml' ], 'development_status': 'Beta', 'maintainers': [ diff --git a/agreement_serviceprofile/models/__init__.py b/agreement_serviceprofile/models/__init__.py index 7bf42742..a0e6354c 100644 --- a/agreement_serviceprofile/models/__init__.py +++ b/agreement_serviceprofile/models/__init__.py @@ -1 +1,2 @@ from . import agreement_serviceprofile +from . import agreement diff --git a/agreement_serviceprofile/models/agreement.py b/agreement_serviceprofile/models/agreement.py new file mode 100644 index 00000000..ac4361a2 --- /dev/null +++ b/agreement_serviceprofile/models/agreement.py @@ -0,0 +1,12 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class Agreement(models.Model): + _inherit = 'agreement' + + serviceprofile_ids = fields.One2many('agreement.serviceprofile', + 'agreement_id', + string="Service Profiles") diff --git a/agreement_serviceprofile/models/agreement_serviceprofile.py b/agreement_serviceprofile/models/agreement_serviceprofile.py index 07a369d4..a645b5ee 100644 --- a/agreement_serviceprofile/models/agreement_serviceprofile.py +++ b/agreement_serviceprofile/models/agreement_serviceprofile.py @@ -12,8 +12,10 @@ class AgreementServiceProfile(models.Model): name = fields.Char(string="Name", required=True) agreement_id = fields.Many2one('agreement', string="Agreement", ondelete="cascade") - active = fields.Boolean( - string="Active", - default=True, - help="If unchecked, it will allow you to hide this service profile" - " without removing it.") + active = fields.Boolean(string="Active", + default=True, + help="If unchecked, it will allow you " + + "to hide this service profile" + " without removing it.") + + notes = fields.Text(string="Notes") diff --git a/agreement_serviceprofile/views/agreement.xml b/agreement_serviceprofile/views/agreement.xml new file mode 100644 index 00000000..6307dd7a --- /dev/null +++ b/agreement_serviceprofile/views/agreement.xml @@ -0,0 +1,24 @@ + + + + + agreement.form.fsm.order.view + agreement + + + + + + + + +
+ + + + +
+
+
+
+
diff --git a/agreement_serviceprofile/views/agreement_serviceprofile.xml b/agreement_serviceprofile/views/agreement_serviceprofile.xml index d559189d..f8c1571f 100644 --- a/agreement_serviceprofile/views/agreement_serviceprofile.xml +++ b/agreement_serviceprofile/views/agreement_serviceprofile.xml @@ -40,6 +40,9 @@ + + +