Browse Source

Merge pull request #348 from ursais/sc_agree_servicepro

[IMP] agreement_serviceprofile
pull/355/head
Maxime Chambreuil 6 years ago
committed by GitHub
parent
commit
c8b7f83d30
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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': [ 'data': [
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'views/agreement_serviceprofile.xml', 'views/agreement_serviceprofile.xml',
'views/agreement.xml'
], ],
'development_status': 'Beta', 'development_status': 'Beta',
'maintainers': [ 'maintainers': [

1
agreement_serviceprofile/models/__init__.py

@ -1 +1,2 @@
from . import agreement_serviceprofile 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) name = fields.Char(string="Name", required=True)
agreement_id = fields.Many2one('agreement', string="Agreement", agreement_id = fields.Many2one('agreement', string="Agreement",
ondelete="cascade") 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></group>
</group> </group>
<group string="Notes">
<field name="notes" nolabel="1" widget="html"/>
</group>
</sheet> </sheet>
</form> </form>
</field> </field>

Loading…
Cancel
Save