Browse Source

Merge pull request #237 from ursais/11.0-imp-agreement

[IMP] agreement 11.0.0.1.0
pull/239/head
Maxime Chambreuil 6 years ago
committed by GitHub
parent
commit
0767c698eb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      agreement/__manifest__.py
  2. 3
      agreement/models/__init__.py
  3. 22
      agreement/models/agreement.py
  4. 24
      agreement/models/agreement_appendix.py
  5. 65
      agreement/models/agreement_clause.py
  6. 24
      agreement/models/agreement_recital.py
  7. 65
      agreement/models/agreement_section.py
  8. 18
      agreement/models/agreement_serviceprofile.py
  9. 1
      agreement/models/agreement_stage.py
  10. 15
      agreement/models/agreement_status.py
  11. 16
      agreement/models/agreement_subtype.py
  12. 16
      agreement/models/agreement_type.py
  13. 5
      agreement/models/product_template.py
  14. 1
      agreement/models/res_partner.py
  15. 34
      agreement/report/agreement.xml
  16. 6
      agreement/security/ir.model.access.csv
  17. 53
      agreement/views/agreement.xml
  18. 68
      agreement/views/agreement_appendix.xml
  19. 60
      agreement/views/agreement_clause.xml
  20. 68
      agreement/views/agreement_recital.xml
  21. 58
      agreement/views/agreement_section.xml
  22. 62
      agreement/views/agreement_serviceprofile.xml
  23. 11
      agreement/views/agreement_subtype.xml
  24. 18
      agreement/views/agreement_type.xml
  25. 33
      agreement/views/menu.xml

5
agreement/__manifest__.py

@ -10,7 +10,7 @@
'website': 'https://github.com/OCA/contract',
'category': 'Partner',
'license': 'AGPL-3',
'version': '11.0.0.0.1',
'version': '11.0.0.1.0',
'depends': [
'account',
'contacts',
@ -27,8 +27,11 @@
'report/agreement.xml',
'views/res_config_settings.xml',
'views/agreement.xml',
'views/agreement_appendix.xml',
'views/agreement_clause.xml',
'views/agreement_recital.xml',
'views/agreement_section.xml',
'views/agreement_serviceprofile.xml',
'views/agreement_stages.xml',
'views/agreement_type.xml',
'views/agreement_subtype.xml',

3
agreement/models/__init__.py

@ -4,8 +4,11 @@ from . import (
res_config_settings,
account,
agreement,
agreement_appendix,
agreement_clause,
agreement_recital,
agreement_section,
agreement_serviceprofile,
agreement_stage,
agreement_type,
agreement_subtype,

22
agreement/models/agreement.py

@ -265,18 +265,18 @@ class Agreement(models.Model):
string="Service Order Lines",
copy=False
)
sections_ids = fields.One2many(
'agreement.section',
recital_ids = fields.One2many('agreement.recital', 'agreement_id',
string="Recitals", copy=True)
sections_ids = fields.One2many('agreement.section', 'agreement_id',
string="Sections", copy=True)
clauses_ids = fields.One2many('agreement.clause', 'agreement_id',
string="Clauses", copy=True)
appendix_ids = fields.One2many('agreement.appendix', 'agreement_id',
string="Appendices", copy=True)
serviceprofile_ids = fields.One2many('agreement.serviceprofile',
'agreement_id',
string="Sections",
copy=True
)
clauses_ids = fields.One2many(
'agreement.clause',
'agreement_id',
string="Clauses",
copy=True
)
string="Service Profiles",
readonly=True)
analytic_id = fields.Many2one('account.analytic.account',
string='Analytic Account', index=True)
analytic_line_ids = fields.One2many('account.analytic.line',

24
agreement/models/agreement_appendix.py

@ -0,0 +1,24 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AgreementAppendix(models.Model):
_name = 'agreement.appendix'
_description = 'Agreement Appendices'
_order = "sequence"
name = fields.Char(string="Name", required=True)
title = fields.Char(string="Title", required=True,
help="The title is displayed on the PDF."
"The name is not.")
sequence = fields.Integer(string="Sequence", default=10)
content = fields.Html(string="Content")
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 appendix without "
"removing it.")

65
agreement/models/agreement_clause.py

@ -1,22 +1,19 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
from odoo import fields, models
# Main Agreement clause Records Model
class AgreementClause(models.Model):
_name = 'agreement.clause'
_order = 'clause_sequence'
_description = 'Agreement Clauses'
_order = 'sequence'
# General
name = fields.Char(
string="Title",
required=True
)
clause_sequence = fields.Integer(
string="Sequence"
)
name = fields.Char(string="Name", required=True)
title = fields.Char(string="Title",
help="The title is displayed on the PDF."
"The name is not.")
sequence = fields.Integer(string="Sequence")
agreement_id = fields.Many2one(
'agreement',
string="Agreement",
@ -27,54 +24,10 @@ class AgreementClause(models.Model):
string="Section",
ondelete="cascade"
)
content = fields.Html(
string="Clause Content"
)
content = fields.Html(string="Clause Content")
active = fields.Boolean(
string="Active",
default=True,
help="If unchecked, it will allow you to hide the agreement without "
"removing it."
)
# Placeholder fields
model_id = fields.Many2one(
'ir.model',
string="Applies to",
help="The type of document this template can be used with."
)
model_object_field_id = fields.Many2one(
'ir.model.fields',
string="Field",
help="Select target field from the related document model. If it is a "
"relationship field you will be able to select a target field at "
"the destination of the relationship."
)
sub_object_id = fields.Many2one(
'ir.model',
string="Sub-model",
help="When a relationship field is selected as first field, this "
"field shows the document model the relationship goes to."
)
sub_model_object_field_id = fields.Many2one(
'ir.model.fields',
string="Sub-field",
help="When a relationship field is selected as first field, this "
"field lets you select the target field within the destination "
"document model (sub-model)."
)
null_value = fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty."
)
copyvalue = fields.Char(
string="Placeholder Expression",
help="Final placeholder expression, to be copy-pasted in the desired "
"template field."
)
@api.model
def create(self, vals):
seq = self.env['ir.sequence'].next_by_code('agreement.clause') or '/'
vals['clause_sequence'] = seq
return super(AgreementClause, self).create(vals)

24
agreement/models/agreement_recital.py

@ -0,0 +1,24 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AgreementRecital(models.Model):
_name = 'agreement.recital'
_description = 'Agreement Recitals'
_order = "sequence"
name = fields.Char(string="Name", required=True)
title = fields.Char(string="Title",
help="The title is displayed on the PDF."
"The name is not.")
sequence = fields.Integer(string="Sequence", default=10)
content = fields.Html(string="Content")
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 recital without "
"removing it.")

65
agreement/models/agreement_section.py

@ -1,22 +1,19 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
from odoo import fields, models
# Main Agreement Section Records Model
class AgreementSection(models.Model):
_name = 'agreement.section'
_order = 'section_sequence'
_description = 'Agreement Sections'
_order = 'sequence'
# General
name = fields.Char(
string="Title",
required=True
)
section_sequence = fields.Integer(
string="Sequence"
)
name = fields.Char(string="Name", required=True)
title = fields.Char(string="Title",
help="The title is displayed on the PDF."
"The name is not.")
sequence = fields.Integer(string="Sequence")
agreement_id = fields.Many2one(
'agreement',
string="Agreement",
@ -27,54 +24,10 @@ class AgreementSection(models.Model):
'section_id',
string="Clauses"
)
content = fields.Html(
string="Section Content"
)
content = fields.Html(string="Section Content")
active = fields.Boolean(
string="Active",
default=True,
help="If unchecked, it will allow you to hide the agreement without "
"removing it."
)
# Placeholder fields
model_id = fields.Many2one(
'ir.model',
string="Applies to",
help="The type of document this template can be used with."
)
model_object_field_id = fields.Many2one(
'ir.model.fields',
string="Field",
help="Select target field from the related document model. If it is a "
"relationship field you will be able to select a target field at "
"the destination of the relationship."
)
sub_object_id = fields.Many2one(
'ir.model',
string="Sub-model",
help="When a relationship field is selected as first field, this "
"field shows the document model the relationship goes to."
)
sub_model_object_field_id = fields.Many2one(
'ir.model.fields',
string="Sub-field",
help="When a relationship field is selected as first field, this "
"field lets you select the target field within the destination "
"document model (sub-model)."
)
null_value = fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty."
)
copyvalue = fields.Char(
string="Placeholder Expression",
help="Final placeholder expression, to be copy-pasted in the desired "
"template field."
)
@api.model
def create(self, vals):
seq = self.env['ir.sequence'].next_by_code('agreement.section') or '/'
vals['section_sequence'] = seq
return super(AgreementSection, self).create(vals)

18
agreement/models/agreement_serviceprofile.py

@ -0,0 +1,18 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AgreementServiceProfile(models.Model):
_name = 'agreement.serviceprofile'
_description = 'Agreement Service Profiles'
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.")

1
agreement/models/agreement_stage.py

@ -7,6 +7,7 @@ from odoo import models, fields
# Main Agreement Section Records Model
class AgreementStage(models.Model):
_name = 'agreement.stage'
_description = 'Agreement Stages'
_order = 'sequence'
# General

15
agreement/models/agreement_status.py

@ -1,15 +0,0 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
# Main Agreement Status Records Model
class AgreementStatus(models.Model):
_name = 'agreement.type'
# General
name = fields.Char(
string="Title",
required=True
)

16
agreement/models/agreement_subtype.py

@ -1,19 +1,13 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
from odoo import fields, models
# Main Agreement Section Records Model
class AgreementSubtype(models.Model):
_name = 'agreement.subtype'
_description = 'Agreement Subtypes'
# General
name = fields.Char(
string="Title",
required=True
)
agreement_type_id = fields.Many2one(
'agreement.type',
string="Agreement Type"
)
name = fields.Char(string="Name", required=True)
agreement_type_id = fields.Many2one('agreement.type',
string="Agreement Type")

16
agreement/models/agreement_type.py

@ -1,20 +1,14 @@
# Copyright (C) 2018 - TODAY, Pavlov Media
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
from odoo import fields, models
# Main Agreement Section Records Model
class AgreementType(models.Model):
_name = 'agreement.type'
_description = 'Agreement Types'
# General
name = fields.Char(
string="Title",
required=True
)
agreement_subtypes_ids = fields.One2many(
'agreement.subtype',
name = fields.Char(string="Name", required=True)
agreement_subtypes_ids = fields.One2many('agreement.subtype',
'agreement_type_id',
string="Agreement"
)
string="Subtypes")

5
agreement/models/product_template.py

@ -7,7 +7,4 @@ from odoo import models, fields
class Product(models.Model):
_inherit = 'product.template'
agreements_ids = fields.Many2many(
'agreement',
string="Agreements"
)
agreements_ids = fields.Many2many('agreement', string="Agreements")

1
agreement/models/res_partner.py

@ -6,5 +6,6 @@ from odoo import models, fields
class Partner(models.Model):
_inherit = 'res.partner'
agreement_ids = fields.One2many('agreement', 'partner_id',
string="Agreements")

34
agreement/report/agreement.xml

@ -45,17 +45,38 @@
Represented by <span t-field="doc.partner_contact_id.name"/>.
</div>
<h2>Agreement</h2>
<h3>Recitals</h3>
<table class="table table-condensed">
<tbody>
<tr>
<td>
<ol>
<li t-foreach="doc.recital_ids" t-as="r">
<t t-if="r.title">
<h3 t-field="r.title"/>
</t>
<p t-field="r.content"/>
</li>
</ol>
</td>
</tr>
</tbody>
</table>
<table class="table table-condensed">
<tbody class="section_tbody">
<tr>
<td>
<ol>
<li t-foreach="doc.sections_ids" t-as="s">
<h3 t-field="s.name"/>
<t t-if="s.title">
<h3 t-field="s.title"/>
</t>
<p t-field="s.content"/>
<ol>
<li t-foreach="s.clauses_ids" t-as="c">
<h4 t-field="c.name"/>
<t t-if="c.title">
<h4 t-field="c.title"/>
</t>
<p t-field="c.content"/>
</li>
</ol>
@ -65,10 +86,12 @@
</tr>
</tbody>
</table>
<t t-if="special_term">
<h2>Special Terms</h2>
<div name="special_term">
<p t-field="doc.special_terms"/>
</div>
</t>
<h2>Signatures</h2>
<table class="table table-condensed">
<theader>
@ -105,6 +128,13 @@
</tbody>
</table>
</div>
<div t-foreach="doc.appendix_ids" t-as="a">
<div class="page">
<h1 t-field="a.title"
style="page-break-before: always;"/>
<p t-field="a.content"/>
</div>
</div>
</t>
</t>
</t>

6
agreement/security/ir.model.access.csv

@ -1,10 +1,16 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_agreement_allusers,agreement all users,model_agreement,agreement.group_agreement_user,1,1,1,0
access_agreement_manager,agreement manager,model_agreement,agreement.group_agreement_manager,1,1,1,1
access_agreement_recital_allusers,recital all users,model_agreement_recital,agreement.group_agreement_user,1,1,1,0
access_agreement_recital_manager,recital manager,model_agreement_recital,agreement.group_agreement_manager,1,1,1,1
access_agreement_section_allusers,section all users,model_agreement_section,agreement.group_agreement_user,1,1,1,0
access_agreement_section_manager,section manager,model_agreement_section,agreement.group_agreement_manager,1,1,1,1
access_agreement_clause_allusers,clause all users,model_agreement_clause,agreement.group_agreement_user,1,1,1,0
access_agreement_clause_manager,clause manager,model_agreement_clause,agreement.group_agreement_manager,1,1,1,1
access_agreement_appendix_allusers,appendix all users,model_agreement_appendix,agreement.group_agreement_user,1,1,1,0
access_agreement_appendix_manager,appendix manager,model_agreement_appendix,agreement.group_agreement_manager,1,1,1,1
access_agreement_servprof_allusers,service profile all users,model_agreement_serviceprofile,agreement.group_agreement_user,1,1,1,0
access_agreement_servprof_manager,service profile manager,model_agreement_serviceprofile,agreement.group_agreement_manager,1,1,1,1
access_agreement_stage_allusers,stage all users,model_agreement_stage,agreement.group_agreement_user,1,0,0,0
access_agreement_stage_manager,stage manager,model_agreement_stage,agreement.group_agreement_manager,1,1,1,1
access_agreement_type_allusers,type all users,model_agreement_type,agreement.group_agreement_user,1,0,0,0

53
agreement/views/agreement.xml

@ -6,7 +6,7 @@
<field name="name">Agreement List</field>
<field name="model">agreement</field>
<field name="arch" type="xml">
<tree default_order='name'>
<tree string="Agreements" default_order='name'>
<field name="name"/>
<field name="partner_id"/>
<field name="company_partner_id"/>
@ -120,27 +120,26 @@
<button name="%(partner_agreement_contract_document_preview)d" string="Preview" type="action" class="oe_highlight"/>
<button name="%(partner_agreement_contract_document)d" string="Print" type="action" class="oe_highlight"/>
</div>
<group string="Sections" default_order='section_sequence'>
<separator string="Recitals"/>
<field name="recital_ids"
default_order="sequence"
nolabel="1"
context="{'default_agreement': active_id}"/>
<separator string="Sections"/>
<field name="sections_ids"
default_order='sequence'
nolabel="1"
context="{'default_agreement': active_id}">
<tree default_order='section_sequence'>
<field name="section_sequence" widget="handle"/>
<field name="name"/>
</tree>
</field>
</group>
<group string="Clauses" default_order='section_id, clause_sequence'>
context="{'default_agreement': active_id}"/>
<separator string="Clauses"/>
<field name="clauses_ids"
default_order='clause_id, sequence'
nolabel="1"
context="{'default_agreement': active_id}">
<tree default_order='section_id, clause_sequence'>
<field name="clause_sequence" widget="handle"/>
<field name="section_id"/>
<field name="name"/>
</tree>
</field>
</group>
context="{'default_agreement': active_id}"/>
<separator string="Appendices"/>
<field name="appendix_ids"
default_order='sequence'
nolabel="1"
context="{'default_agreement': active_id}"/>
</page>
<page name="signature" string="Signatures">
<group>
@ -161,6 +160,9 @@
<field name="product_ids" nolabel="1"/>
</group>
</page>
<page name="serviceprofiles" string="Service Profiles">
<field name="serviceprofile_ids" nolabel="1"/>
</page>
<page name="financials" string="Financials">
<group>
<group>
@ -173,19 +175,6 @@
readonly="1"
nolabel="1"/>
</group>
<!--
<group string="Financial Details>
<group string="Company">
<field name="total_company_mrc"/>
<field name="total_company_nrc"/>
<field name="currency_id"/>
<field name="contract_value" readonly="1"/>
</group>
<group string="Customer">
<field name="total_customer_mrc"/>
<field name="total_customer_nrc"/>
</group>
</group> -->
</page>
<page name="child_agreements" string="Child Agreements">
<field name="child_agreements_ids">
@ -205,7 +194,7 @@
</tree>
</field>
</page>
<page name="peformance" string="Performance">
<page name="performance" string="Performance">
<p>This section is a place where financial records will show the current performance of this agreement.</p>
<p>Perhaps include invoices with total vs costs? </p>
</page>

68
agreement/views/agreement_appendix.xml

@ -0,0 +1,68 @@
<?xml version="1.0"?>
<odoo>
<!-- Agreement Appendix List View-->
<record model="ir.ui.view" id="agreement_appendix_tree">
<field name="name">Agreement Appendix Tree</field>
<field name="model">agreement.appendix</field>
<field name="arch" type="xml">
<tree string="Appendices" default_order='agreement_id, sequence'>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="title"/>
<field name="agreement_id"/>
<field name="active" invisible="1"/>
</tree>
</field>
</record>
<!-- Agreement Appendix Form View -->
<record model="ir.ui.view" id="agreement_appendix_form">
<field name="name">Agreement Appendix Form</field>
<field name="model">agreement.appendix</field>
<field name="arch" type="xml">
<form string="Appendix">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group>
<group>
<field name="title"/>
<field name="agreement_id"/>
</group>
<group>
<field name="sequence"/>
</group>
</group>
<field name="content" widget="html"/>
</sheet>
</form>
</field>
</record>
<!-- Agreement Appendix Search View -->
<record model="ir.ui.view" id="agreement_appendix_search">
<field name="name">Agreement Appendix Search</field>
<field name="model">agreement.appendix</field>
<field name="arch" type="xml">
<search>
<filter name="group_agreement" icon="terp-partner" context="{'group_by':'agreement_id'}"/>
</search>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="agreement_appendix_action">
<field name="name">Appendices</field>
<field name="res_model">agreement.appendix</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

60
agreement/views/agreement_clause.xml

@ -1,25 +1,17 @@
<?xml version="1.0"?>
<odoo>
<!-- Agreement Clauses Sequences-->
<record id="seq_agreement_clause" model="ir.sequence">
<field name="name">agreement_clause_sequencer</field>
<field name="code">agreement.clause</field>
<field name="prefix">0</field>
<field name="padding">1</field>
</record>
<!-- Agreement Clause List View-->
<record model="ir.ui.view" id="partner_agreement_clause_list_view">
<field name="name">Agreement Clause List</field>
<field name="model">agreement.clause</field>
<field name="arch" type="xml">
<tree default_order='agreement_id, clause_sequence'>
<field name="clause_sequence" widget="handle"/>
<field name="agreement_id"/>
<tree string="Clauses" default_order='agreement_id, sequence'>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="title"/>
<field name="agreement_id"/>
<field name="section_id"/>
<field name="content" widget="html"/>
<field name="active" invisible="1"/>
</tree>
</field>
@ -30,31 +22,28 @@
<field name="name">Agreement clause Form</field>
<field name="model">agreement.clause</field>
<field name="arch" type="xml">
<form string="Agreements Clause Form">
<form string="Clause">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Clause Name"/>
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group>
<group>
<field name="title"/>
<field name="agreement_id"/>
<field name="section_id" domain="[('agreement_id', '=', agreement_id)]"/>
<field name="content" widget="html"/>
</group>
<notebook>
<page string="Dynamic Placeholder Generator">
THIS IS UNDER DEVELOPEMENT: The purpose of this section is to be able to create dynamic fields inside your content.
<group>
<field name="model_id"/>
<field name="model_object_field_id" domain="[('model_id','=',model_id),('ttype','!=','one2many'),('ttype','!=','many2many')]"/>
<field name="sub_object_id" readonly="1"/>
<field name="sub_model_object_field_id" domain="[('model_id','=',sub_object_id),('ttype','!=','one2many'),('ttype','!=','many2many')]" attrs="{'readonly':[('sub_object_id','=',False)],'required':[('sub_object_id','!=',False)]}"/>
<field name="null_value"/>
<field name="copyvalue"/>
<field name="sequence"/>
</group>
</page>
</notebook>
Sequence #<field name="clause_sequence"/>
</group>
<field name="content" widget="html"/>
</sheet>
</form>
</field>
@ -72,24 +61,11 @@
</field>
</record>
<!-- Agreement Clause Pivot View -->
<record model="ir.ui.view" id="agreement_clause_pivot_view">
<field name="name">Agreement Clause Pivot</field>
<field name="model">agreement.clause</field>
<field name="arch" type="xml">
<pivot string="Agreement Clause Pivot">
<field name="agreement_id" type="row"/>
<field name="section_id" type="row"/>
<field name="name" type="row"/>
</pivot>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_clause">
<field name="name">Agreement Clauses</field>
<field name="name">Clauses</field>
<field name="res_model">agreement.clause</field>
<field name="view_mode">tree,pivot,form</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

68
agreement/views/agreement_recital.xml

@ -0,0 +1,68 @@
<?xml version="1.0"?>
<odoo>
<!-- Agreement Recital List View-->
<record model="ir.ui.view" id="agreement_recital_tree">
<field name="name">Agreement Recital Tree</field>
<field name="model">agreement.recital</field>
<field name="arch" type="xml">
<tree string="Recitals" default_order='agreement_id, sequence'>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="title"/>
<field name="agreement_id"/>
<field name="active" invisible="1"/>
</tree>
</field>
</record>
<!-- Agreement Recital Form View -->
<record model="ir.ui.view" id="agreement_recital_form">
<field name="name">Agreement Recital Form</field>
<field name="model">agreement.recital</field>
<field name="arch" type="xml">
<form string="Recital">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group>
<group>
<field name="title"/>
<field name="agreement_id"/>
</group>
<group>
<field name="sequence"/>
</group>
</group>
<field name="content" widget="html"/>
</sheet>
</form>
</field>
</record>
<!-- Agreement Recital Search View -->
<record model="ir.ui.view" id="agreement_recital_search">
<field name="name">Agreement Recital Search</field>
<field name="model">agreement.recital</field>
<field name="arch" type="xml">
<search>
<filter name="group_agreement" icon="terp-partner" context="{'group_by':'agreement_id'}"/>
</search>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="agreement_recital_action">
<field name="name">Recitals</field>
<field name="res_model">agreement.recital</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

58
agreement/views/agreement_section.xml

@ -1,23 +1,16 @@
<?xml version="1.0"?>
<odoo>
<!-- Agreement Sections Sequences-->
<record id="seq_agreement_section" model="ir.sequence">
<field name="name">agreement_section_sequencer</field>
<field name="code">agreement.section</field>
<field name="prefix">0</field>
<field name="padding">1</field>
</record>
<!-- Agreement Sections List View-->
<record model="ir.ui.view" id="partner_agreement_section_list_view">
<field name="name">Agreement Section List</field>
<field name="model">agreement.section</field>
<field name="arch" type="xml">
<tree default_order='agreement_id, section_sequence'>
<field name="agreement_id" string="Agreement"/>
<field name="section_sequence" string="Sequence"/>
<field name="name" string="Section Name"/>
<tree string="Sections" default_order='agreement_id, sequence'>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="title"/>
<field name="agreement_id"/>
<field name="active" invisible="1"/>
</tree>
</field>
@ -28,41 +21,42 @@
<field name="name">Agreement Section Form</field>
<field name="model">agreement.section</field>
<field name="arch" type="xml">
<form string="Agreements Section Form">
<form string="Section">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Section Name"/>
<h1><field name="name" string="Section Name"/></h1>
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group>
<field name="agreement_id" string="Agreement"/>
<group>
<field name="title"/>
<field name="agreement_id"/>
</group>
<group>
<field name='content' string="Content"/>
<field name="sequence"/>
</group>
</group>
<notebook>
<page string="Content">
<field name='content' nolabel="1"/>
</page>
<page string="Clauses">
<field name="clauses_ids" string="Clauses" context="{'default_section_id': active_id,'default_agreement_id': agreement_id}">
<field name="clauses_ids"
nolabel="1"
context="{'default_section_id': active_id, 'default_agreement_id': agreement_id}">
<tree>
<field name="clause_sequence" widget="handle"/>
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="content"/>
<field name="title"/>
</tree>
</field>
</page>
<page string="Dynamic Placeholder Generator">
THIS IS UNDER DEVELOPEMENT: The purpose of this section is to be able to create dynamic fields inside your content.
<group>
<field name="model_id"/>
<field name="model_object_field_id" domain="[('model_id','=',model_id),('ttype','!=','one2many'),('ttype','!=','many2many')]"/>
<field name="sub_object_id" readonly="1"/>
<field name="sub_model_object_field_id" domain="[('model_id','=',sub_object_id),('ttype','!=','one2many'),('ttype','!=','many2many')]" attrs="{'readonly':[('sub_object_id','=',False)],'required':[('sub_object_id','!=',False)]}"/>
<field name="null_value"/>
<field name="copyvalue"/>
</group>
</page>
</notebook>
Sequence #<field name="section_sequence" readonly="1"/>
</sheet>
</form>
</field>

62
agreement/views/agreement_serviceprofile.xml

@ -0,0 +1,62 @@
<?xml version="1.0"?>
<odoo>
<!-- Agreement Service Profile List View-->
<record model="ir.ui.view" id="agreement_serviceprofile_tree">
<field name="name">Agreement Service Profile Tree</field>
<field name="model">agreement.serviceprofile</field>
<field name="arch" type="xml">
<tree string="Service Profiles" default_order='agreement_id'>
<field name="name"/>
<field name="agreement_id"/>
<field name="active" invisible="1"/>
</tree>
</field>
</record>
<!-- Agreement Service Profile Form View -->
<record model="ir.ui.view" id="agreement_serviceprofile_form">
<field name="name">Agreement Service Profile Form</field>
<field name="model">agreement.serviceprofile</field>
<field name="arch" type="xml">
<form string="Service Profile">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button" options="{&quot;terminology&quot;: &quot;archive&quot;}"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group>
<group>
<field name="agreement_id"/>
</group>
<group></group>
</group>
</sheet>
</form>
</field>
</record>
<!-- Agreement Service Profile Search View -->
<record model="ir.ui.view" id="agreement_serviceprofile_search">
<field name="name">Agreement Service Profile Search</field>
<field name="model">agreement.serviceprofile</field>
<field name="arch" type="xml">
<search>
<filter name="group_agreement" icon="terp-partner" context="{'group_by':'agreement_id'}"/>
</search>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="agreement_serviceprofile_action">
<field name="name">Service Profiles</field>
<field name="res_model">agreement.serviceprofile</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

11
agreement/views/agreement_subtype.xml

@ -20,12 +20,15 @@
<field name="arch" type="xml">
<form string="Agreement Sub-Types">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group>
<field name="name"/>
</group>
<group>
<field name="agreement_type_id"
required="True"/>
<field name="agreement_type_id"/>
</group>
<group></group>
</group>
</sheet>
</form>

18
agreement/views/agreement_type.xml

@ -6,7 +6,7 @@
<field name="name">Agreement Type List</field>
<field name="model">agreement.type</field>
<field name="arch" type="xml">
<tree default_order='name'>
<tree string="Agreement Types" default_order='name'>
<field name="name" string="Type Name"/>
<field name="agreement_subtypes_ids" string="Sub-Types"/>
</tree>
@ -18,14 +18,14 @@
<field name="name">Agreement Type Form</field>
<field name="model">agreement.type</field>
<field name="arch" type="xml">
<form string="Agreements Type Form">
<form string="Agreement Type">
<sheet>
<group>
<field name="name"/>
</group>
<group string="Sub-Types">
<field name="agreement_subtypes_ids" nolabel="1"/>
</group>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<field name="agreement_subtypes_ids"
nolabel="1"/>
</sheet>
</form>
</field>
@ -33,7 +33,7 @@
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_type">
<field name="name">Agreement Type</field>
<field name="name">Agreement Types</field>
<field name="res_model">agreement.type</field>
<field name="view_mode">tree,form</field>
</record>

33
agreement/views/menu.xml

@ -42,21 +42,44 @@
parent="agreement_root"
sequence="30"/>
<menuitem
name="Clauses"
id="agreement_clauses"
name="Contents"
id="agreement_data_contents"
parent="agreement_masterdata"
sequence="10"/>
<menuitem
name="Recitals"
id="agreement_recitals"
parent="agreement_data_contents"
sequence="10"
action="agreement_recital_action"/>
<menuitem
name="Clauses"
id="agreement_clauses"
parent="agreement_data_contents"
sequence="20"
action="partner_agreement_action_clause"/>
<menuitem
name="Sections"
id="agreement_sections"
parent="agreement_masterdata"
sequence="20"
parent="agreement_data_contents"
sequence="30"
action="partner_agreement_action_section"/>
<menuitem
name="Appendices"
id="agreement_appendices"
parent="agreement_data_contents"
sequence="40"
action="agreement_appendix_action"/>
<menuitem
name="Service Profiles"
id="agreement_serviceprofiles"
parent="agreement_masterdata"
sequence="50"
action="agreement_serviceprofile_action"/>
<menuitem
name="Products"
id="agreement_products"
sequence="30"
sequence="100"
parent="agreement_masterdata"
action="product.product_template_action"/>

Loading…
Cancel
Save