Browse Source

[ADD] Notes to ServPro, add ServPro to Agreement

[IMP] Flake8

[IMP] github changes

[IMP] Placeholder in notes remove <p><br></p>
pull/348/head
scampbell 6 years ago
parent
commit
297e031e0b
  1. 1
      agreement_serviceprofile/__manifest__.py
  2. 1
      agreement_serviceprofile/models/__init__.py
  3. 12
      agreement_serviceprofile/models/agreement.py
  4. 12
      agreement_serviceprofile/models/agreement_serviceprofile.py
  5. 24
      agreement_serviceprofile/views/agreement.xml
  6. 3
      agreement_serviceprofile/views/agreement_serviceprofile.xml

1
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': [

1
agreement_serviceprofile/models/__init__.py

@ -1 +1,2 @@
from . import agreement_serviceprofile
from . import agreement

12
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")

12
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")

24
agreement_serviceprofile/views/agreement.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Agreement Form View -->
<record id="agreement_fsm_order_form_view" model="ir.ui.view">
<field name="name">agreement.form.fsm.order.view</field>
<field name="model">agreement</field>
<field name="inherit_id" ref="agreement_legal.partner_agreement_form_view"/>
<field name="arch" type="xml">
<notebook position="inside">
<page name="serviceprofiles" string="Service Profiles">
<field name="serviceprofile_ids">
<tree>
<field name="name"/>
</tree>
<form>
<field name="name"/>
<field name="notes" placeholder="Add Notes Here..."/>
</form>
</field>
</page>
</notebook>
</field>
</record>
</odoo>

3
agreement_serviceprofile/views/agreement_serviceprofile.xml

@ -40,6 +40,9 @@
</group>
<group></group>
</group>
<group string="Notes">
<field name="notes" nolabel="1" widget="html"/>
</group>
</sheet>
</form>
</field>

Loading…
Cancel
Save