[IMP] agreement_legal: black, isort, prettier

This commit is contained in:
Víctor Martínez
2021-05-11 12:18:55 +02:00
parent 387e6957f4
commit 2ff068522e
41 changed files with 1306 additions and 896 deletions

View File

@@ -7,6 +7,8 @@ from . import models
def post_init_agreement_legal(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, dict())
cr.execute('UPDATE agreement SET stage_id = %s WHERE stage_id IS NULL;',
(env.ref('agreement_legal.agreement_stage_new').id,))
cr.execute(
"UPDATE agreement SET stage_id = %s WHERE stage_id IS NULL;",
(env.ref("agreement_legal.agreement_stage_new").id,),
)
return True

View File

@@ -35,17 +35,10 @@
"views/agreement.xml",
"views/menu.xml",
],
"demo": [
"demo/demo.xml"
],
'qweb': [
"static/src/xml/domain_widget_view.xml"
],
"demo": ["demo/demo.xml"],
"qweb": ["static/src/xml/domain_widget_view.xml"],
"post_init_hook": "post_init_agreement_legal",
"application": True,
"development_status": "Beta",
"maintainers": [
"max3903",
"ygol"
],
"maintainers": ["max3903", "ygol"],
}

View File

@@ -1,54 +1,45 @@
<?xml version="1.0"?>
<?xml version="1.0" ?>
<odoo>
<record id="agreement_stage_new" model="agreement.stage">
<field name="name">New</field>
<field name="sequence">10</field>
<field name="stage_type">agreement</field>
</record>
<record id="agreement_stage_draft" model="agreement.stage">
<field name="name">Draft</field>
<field name="sequence">20</field>
<field name="stage_type">agreement</field>
</record>
<record id="agreement_stage_reviewed" model="agreement.stage">
<field name="name">Reviewed</field>
<field name="sequence">30</field>
<field name="stage_type">agreement</field>
</record>
<record id="agreement_stage_negotiation" model="agreement.stage">
<field name="name">Negotiation</field>
<field name="sequence">40</field>
<field name="stage_type">agreement</field>
</record>
<record id="agreement_stage_out" model="agreement.stage">
<field name="name">Out for Customer Signature</field>
<field name="sequence">50</field>
<field name="stage_type">agreement</field>
</record>
<record id="agreement_stage_internal" model="agreement.stage">
<field name="name">Waiting Internal Signature</field>
<field name="sequence">60</field>
<field name="stage_type">agreement</field>
</record>
<record id="agreement_stage_active" model="agreement.stage">
<field name="name">Active</field>
<field name="sequence">70</field>
<field name="stage_type">agreement</field>
</record>
<record id="agreement_stage_expired" model="agreement.stage">
<field name="name">Expired</field>
<field name="sequence">80</field>
<field name="stage_type">agreement</field>
</record>
<record id="agreement_stage_cancelled" model="agreement.stage">
<field name="name">Cancelled</field>
<field name="sequence">100</field>

View File

@@ -1,16 +1,12 @@
<?xml version="1.0"?>
<?xml version="1.0" ?>
<odoo>
<record id="agreement_type_agreement" model="agreement.type">
<field name="name">Agreement</field>
</record>
<record id="agreement_type_contract" model="agreement.type">
<field name="name">Contract</field>
</record>
<record id="agreement_type_loi" model="agreement.type">
<field name="name">Letter of Intent</field>
</record>
</odoo>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- Sequence for agreement -->
<record id="seq_agreement" model="ir.sequence">
<field name="name">Agreements</field>
<field name="code">agreement</field>
<field name="prefix">AG</field>
<field name="padding">3</field>
<field name="company_id" eval="False"/>
<field name="company_id" eval="False" />
</record>
</odoo>

View File

@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="agreement" model="ir.module.category">
<field name="name">Agreement</field>
<field name="sequence">80</field>
</record>
</odoo>

View File

@@ -1,40 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
© 2019 Ygol Internetwork (yves@ygol.com)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record id="agreement.market1" model="agreement">
<field name="description">Hardware IT (C2C-IT0042)</field>
<field name="agreement_type_id" ref="agreement_type_agreement"/>
<field name="agreement_type_id" ref="agreement_type_agreement" />
</record>
<record id="agreement.market2" model="agreement">
<field name="description">Fiber access office Lausanne (C2C-IT0043)</field>
<field name="agreement_type_id" ref="agreement_type_contract"/>
<field name="agreement_type_id" ref="agreement_type_contract" />
</record>
<record id="agreement.market3" model="agreement">
<field name="description">Vétérinaire (AGR-VETO001)</field>
<field name="agreement_type_id" ref="agreement_type_loi"/>
<field name="agreement_type_id" ref="agreement_type_loi" />
</record>
<record id="agreement.market4" model="agreement">
<field name="description">Wazo IPBX deployment and maintenance (AGR-TEL001)</field>
<field name="agreement_type_id" ref="agreement_type_loi"/>
<field
name="description"
>Wazo IPBX deployment and maintenance (AGR-TEL001)</field>
<field name="agreement_type_id" ref="agreement_type_loi" />
</record>
<record id="agreement.market5" model="agreement">
<field name="description">SIP Phones supply (BUY-VOIP012)</field>
<field name="agreement_type_id" ref="agreement_type_agreement"/>
<field name="agreement_type_id" ref="agreement_type_agreement" />
</record>
<record id="agreement.market6" model="agreement">
<field name="is_template">True</field>
<field name="description">SIP-ISDN gateways (BUY-VOIP013)</field>
<field name="agreement_type_id" ref="agreement_legal.agreement_type_contract"/>
<field name="agreement_type_id" ref="agreement_legal.agreement_type_contract" />
</record>
</odoo>

View File

@@ -6,5 +6,7 @@ def migrate(env, version):
if not version:
return
env.execute("UPDATE agreement_stage SET stage_type = 'agreement' "
"WHERE stage_type IS NULL;")
env.execute(
"UPDATE agreement_stage SET stage_type = 'agreement' "
"WHERE stage_type IS NULL;"
)

View File

@@ -14,122 +14,146 @@ class Agreement(models.Model):
default=1,
copy=False,
help="The versions are used to keep track of document history and "
"previous versions can be referenced.")
"previous versions can be referenced.",
)
revision = fields.Integer(
string="Revision",
default=0,
copy=False,
help="The revision will increase with every save event.")
help="The revision will increase with every save event.",
)
description = fields.Text(
string="Description",
track_visibility="onchange",
help="Description of the agreement")
help="Description of the agreement",
)
dynamic_description = fields.Text(
compute="_compute_dynamic_description",
string="Dynamic Description",
help="Compute dynamic description")
help="Compute dynamic description",
)
start_date = fields.Date(
string="Start Date",
track_visibility="onchange",
help="When the agreement starts.")
help="When the agreement starts.",
)
end_date = fields.Date(
string="End Date",
track_visibility="onchange",
help="When the agreement ends.")
string="End Date", track_visibility="onchange", help="When the agreement ends."
)
color = fields.Integer(string="Color")
active = fields.Boolean(
string="Active",
default=True,
help="If unchecked, it will allow you to hide the agreement without "
"removing it.")
"removing it.",
)
company_signed_date = fields.Date(
string="Signed on",
track_visibility="onchange",
help="Date the contract was signed by Company.")
help="Date the contract was signed by Company.",
)
partner_signed_date = fields.Date(
string="Signed on (Partner)",
track_visibility="onchange",
help="Date the contract was signed by the Partner.")
help="Date the contract was signed by the Partner.",
)
term = fields.Integer(
string="Term (Months)",
track_visibility="onchange",
help="Number of months this agreement/contract is in effect with the "
"partner.")
"partner.",
)
expiration_notice = fields.Integer(
string="Exp. Notice (Days)",
track_visibility="onchange",
help="Number of Days before expiration to be notified.")
help="Number of Days before expiration to be notified.",
)
change_notice = fields.Integer(
string="Change Notice (Days)",
track_visibility="onchange",
help="Number of Days to be notified before changes.")
help="Number of Days to be notified before changes.",
)
special_terms = fields.Text(
string="Special Terms",
track_visibility="onchange",
help="Any terms that you have agreed to and want to track on the "
"agreement/contract.")
"agreement/contract.",
)
dynamic_special_terms = fields.Text(
compute="_compute_dynamic_special_terms",
string="Dynamic Special Terms",
help="Compute dynamic special terms")
help="Compute dynamic special terms",
)
code = fields.Char(
string="Reference",
required=True,
default=lambda self: _("New"),
track_visibility="onchange",
copy=False,
help="ID used for internal contract tracking.")
help="ID used for internal contract tracking.",
)
increase_type_id = fields.Many2one(
"agreement.increasetype",
string="Increase Type",
track_visibility="onchange",
help="The amount that certain rates may increase.")
help="The amount that certain rates may increase.",
)
termination_requested = fields.Date(
string="Termination Requested Date",
track_visibility="onchange",
help="Date that a request for termination was received.")
help="Date that a request for termination was received.",
)
termination_date = fields.Date(
string="Termination Date",
track_visibility="onchange",
help="Date that the contract was terminated.")
reviewed_date = fields.Date(
string="Reviewed Date", track_visibility="onchange")
help="Date that the contract was terminated.",
)
reviewed_date = fields.Date(string="Reviewed Date", track_visibility="onchange")
reviewed_user_id = fields.Many2one(
"res.users", string="Reviewed By", track_visibility="onchange")
approved_date = fields.Date(
string="Approved Date", track_visibility="onchange")
"res.users", string="Reviewed By", track_visibility="onchange"
)
approved_date = fields.Date(string="Approved Date", track_visibility="onchange")
approved_user_id = fields.Many2one(
"res.users", string="Approved By", track_visibility="onchange")
"res.users", string="Approved By", track_visibility="onchange"
)
currency_id = fields.Many2one("res.currency", string="Currency")
partner_id = fields.Many2one(
"res.partner",
string="Partner",
required=False,
copy=True,
help="The customer or vendor this agreement is related to.")
help="The customer or vendor this agreement is related to.",
)
partner_contact_id = fields.Many2one(
"res.partner",
string="Partner Contact",
copy=True,
help="The primary partner contact (If Applicable).")
help="The primary partner contact (If Applicable).",
)
partner_contact_phone = fields.Char(
related="partner_contact_id.phone", string="Partner Phone")
related="partner_contact_id.phone", string="Partner Phone"
)
partner_contact_email = fields.Char(
related="partner_contact_id.email", string="Partner Email")
related="partner_contact_id.email", string="Partner Email"
)
company_contact_id = fields.Many2one(
"res.partner",
string="Company Contact",
copy=True,
help="The primary contact in the company.")
help="The primary contact in the company.",
)
company_contact_phone = fields.Char(
related="company_contact_id.phone", string="Phone")
related="company_contact_id.phone", string="Phone"
)
company_contact_email = fields.Char(
related="company_contact_id.email", string="Email")
related="company_contact_id.email", string="Email"
)
use_parties_content = fields.Boolean(
string="Use parties content",
help="Use custom content for parties")
string="Use parties content", help="Use custom content for parties"
)
company_partner_id = fields.Many2one(
related="company_id.partner_id", string="Company's Partner")
related="company_id.partner_id", string="Company's Partner"
)
def _get_default_parties(self):
deftext = """
@@ -160,97 +184,108 @@ class Agreement(models.Model):
string="Parties",
track_visibility="onchange",
default=_get_default_parties,
help="Parties of the agreement")
help="Parties of the agreement",
)
dynamic_parties = fields.Html(
compute="_compute_dynamic_parties",
string="Dynamic Parties",
help="Compute dynamic parties")
agreement_type_id = fields.Many2one(
track_visibility="onchange",
help="Compute dynamic parties",
)
agreement_type_id = fields.Many2one(track_visibility="onchange",)
agreement_subtype_id = fields.Many2one(
"agreement.subtype",
string="Agreement Sub-type",
track_visibility="onchange",
help="Select the sub-type of this agreement. Sub-Types are related to "
"agreement types.")
product_ids = fields.Many2many(
"product.template", string="Products & Services")
"agreement types.",
)
product_ids = fields.Many2many("product.template", string="Products & Services")
assigned_user_id = fields.Many2one(
"res.users",
string="Assigned To",
track_visibility="onchange",
help="Select the user who manages this agreement.")
help="Select the user who manages this agreement.",
)
company_signed_user_id = fields.Many2one(
"res.users",
string="Signed By",
track_visibility="onchange",
help="The user at our company who authorized/signed the agreement or "
"contract.")
"contract.",
)
partner_signed_user_id = fields.Many2one(
"res.partner",
string="Signed By (Partner)",
track_visibility="onchange",
help="Contact on the account that signed the agreement/contract.")
help="Contact on the account that signed the agreement/contract.",
)
parent_agreement_id = fields.Many2one(
"agreement",
string="Parent Agreement",
help="Link this agreement to a parent agreement. For example if this "
"agreement is an amendment to another agreement. This list will "
"only show other agreements related to the same account.")
"only show other agreements related to the same account.",
)
renewal_type_id = fields.Many2one(
"agreement.renewaltype",
string="Renewal Type",
track_visibility="onchange",
help="Describes what happens after the contract expires.")
help="Describes what happens after the contract expires.",
)
recital_ids = fields.One2many(
"agreement.recital", "agreement_id", string="Recitals", copy=True)
"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")
"agreement.section", "agreement_id", string="Sections", copy=True
)
clauses_ids = fields.One2many("agreement.clause", "agreement_id", string="Clauses")
appendix_ids = fields.One2many(
"agreement.appendix", "agreement_id", string="Appendices", copy=True)
"agreement.appendix", "agreement_id", string="Appendices", copy=True
)
previous_version_agreements_ids = fields.One2many(
"agreement",
"parent_agreement_id",
string="Previous Versions",
copy=False,
domain=[("active", "=", False)])
domain=[("active", "=", False)],
)
child_agreements_ids = fields.One2many(
"agreement",
"parent_agreement_id",
string="Child Agreements",
copy=False,
domain=[("active", "=", True)])
domain=[("active", "=", True)],
)
line_ids = fields.One2many(
"agreement.line",
"agreement_id",
string="Products/Services",
copy=False)
"agreement.line", "agreement_id", string="Products/Services", copy=False
)
state = fields.Selection(
[("draft", "Draft"), ("active", "Active"), ("inactive", "Inactive")],
default="draft",
track_visibility="always")
track_visibility="always",
)
notification_address_id = fields.Many2one(
"res.partner",
string="Notification Address",
help="The address to send notificaitons to, if different from "
"customer address.(Address Type = Other)")
"customer address.(Address Type = Other)",
)
signed_contract_filename = fields.Char(string="Filename")
signed_contract = fields.Binary(
string="Signed Document", track_visibility="always")
signed_contract = fields.Binary(string="Signed Document", track_visibility="always")
# Dynamic field editor
field_domain = fields.Char(string='Field Expression',
default='[["active", "=", True]]')
field_domain = fields.Char(
string="Field Expression", default='[["active", "=", True]]'
)
default_value = fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty.")
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.""")
template field.""",
)
@api.onchange("field_domain", "default_value")
def onchange_copyvalue(self):
@@ -260,8 +295,8 @@ class Agreement(models.Model):
if string_list:
field_domain = string_list[0][3:-1]
self.copyvalue = "${{object.{} or {}}}".format(
field_domain,
self.default_value or "''")
field_domain, self.default_value or "''"
)
# compute the dynamic content for mako expression
@api.multi
@@ -269,9 +304,7 @@ class Agreement(models.Model):
MailTemplates = self.env["mail.template"]
for agreement in self:
lang = agreement.partner_id.lang or "en_US"
description = MailTemplates.with_context(
lang=lang
)._render_template(
description = MailTemplates.with_context(lang=lang)._render_template(
agreement.description, "agreement", agreement.id
)
agreement.dynamic_description = description
@@ -281,9 +314,7 @@ class Agreement(models.Model):
MailTemplates = self.env["mail.template"]
for agreement in self:
lang = agreement.partner_id.lang or "en_US"
parties = MailTemplates.with_context(
lang=lang
)._render_template(
parties = MailTemplates.with_context(lang=lang)._render_template(
agreement.parties, "agreement", agreement.id
)
agreement.dynamic_parties = parties
@@ -293,9 +324,7 @@ class Agreement(models.Model):
MailTemplates = self.env["mail.template"]
for agreement in self:
lang = agreement.partner_id.lang or "en_US"
special_terms = MailTemplates.with_context(
lang=lang
)._render_template(
special_terms = MailTemplates.with_context(lang=lang)._render_template(
agreement.special_terms, "agreement", agreement.id
)
agreement.dynamic_special_terms = special_terms
@@ -304,7 +333,8 @@ class Agreement(models.Model):
@api.model
def _read_group_stage_ids(self, stages, domain, order):
stage_ids = self.env["agreement.stage"].search(
[('stage_type', '=', 'agreement')])
[("stage_type", "=", "agreement")]
)
return stage_ids
stage_id = fields.Many2one(
@@ -313,7 +343,8 @@ class Agreement(models.Model):
group_expand="_read_group_stage_ids",
help="Select the current stage of the agreement.",
track_visibility="onchange",
index=True)
index=True,
)
# Create New Version Button
@api.multi
@@ -345,7 +376,7 @@ class Agreement(models.Model):
"stage_id": self.env.ref("agreement_legal.agreement_stage_new").id,
}
res = self.copy(default=default_vals)
res.sections_ids.mapped('clauses_ids').write({'agreement_id': res.id})
res.sections_ids.mapped("clauses_ids").write({"agreement_id": res.id})
return {
"res_model": "agreement",
"type": "ir.actions.act_window",
@@ -357,12 +388,9 @@ class Agreement(models.Model):
@api.model
def create(self, vals):
if vals.get("code", _("New")) == _("New"):
vals["code"] = self.env["ir.sequence"].next_by_code(
"agreement"
) or _("New")
if not vals.get('stage_id'):
vals["stage_id"] = \
self.env.ref("agreement_legal.agreement_stage_new").id
vals["code"] = self.env["ir.sequence"].next_by_code("agreement") or _("New")
if not vals.get("stage_id"):
vals["stage_id"] = self.env.ref("agreement_legal.agreement_stage_new").id
return super(Agreement, self).create(vals)
# Increments the revision on each save action

View File

@@ -15,19 +15,14 @@ class AgreementAppendix(models.Model):
required=True,
help="The title is displayed on the PDF." "The name is not.",
)
sequence = fields.Integer(
string="Sequence",
default=10)
sequence = fields.Integer(string="Sequence", default=10)
content = fields.Html(string="Content")
dynamic_content = fields.Html(
compute="_compute_dynamic_content",
string="Dynamic Content",
help="compute dynamic Content",
)
agreement_id = fields.Many2one(
"agreement",
string="Agreement",
ondelete="cascade")
agreement_id = fields.Many2one("agreement", string="Agreement", ondelete="cascade")
active = fields.Boolean(
string="Active",
default=True,
@@ -36,15 +31,18 @@ class AgreementAppendix(models.Model):
)
# Dynamic field editor
field_domain = fields.Char(string='Field Expression',
default='[["active", "=", True]]')
field_domain = fields.Char(
string="Field Expression", default='[["active", "=", True]]'
)
default_value = fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty.")
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.""")
template field.""",
)
@api.onchange("field_domain", "default_value")
def onchange_copyvalue(self):
@@ -54,8 +52,8 @@ class AgreementAppendix(models.Model):
if string_list:
field_domain = string_list[0][3:-1]
self.copyvalue = "${{object.{} or {}}}".format(
field_domain,
self.default_value or "''")
field_domain, self.default_value or "''"
)
# compute the dynamic content for mako expression
@api.multi

View File

@@ -11,38 +11,39 @@ class AgreementClause(models.Model):
name = fields.Char(string="Name", required=True)
title = fields.Char(
string="Title",
help="The title is displayed on the PDF." "The name is not.")
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",
ondelete="cascade")
agreement_id = fields.Many2one("agreement", string="Agreement", ondelete="cascade")
section_id = fields.Many2one(
"agreement.section",
string="Section",
ondelete="cascade")
"agreement.section", string="Section", ondelete="cascade"
)
content = fields.Html(string="Clause Content")
dynamic_content = fields.Html(
compute="_compute_dynamic_content",
string="Dynamic Content",
help="compute dynamic Content")
help="compute dynamic Content",
)
active = fields.Boolean(
string="Active",
default=True,
help="If unchecked, it will allow you to hide the agreement without "
"removing it.")
"removing it.",
)
# Dynamic field editor
field_domain = fields.Char(string='Field Expression',
default='[["active", "=", True]]')
field_domain = fields.Char(
string="Field Expression", default='[["active", "=", True]]'
)
default_value = fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty.")
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.""")
template field.""",
)
@api.onchange("field_domain", "default_value")
def onchange_copyvalue(self):
@@ -52,8 +53,8 @@ class AgreementClause(models.Model):
if string_list:
field_domain = string_list[0][3:-1]
self.copyvalue = "${{object.{} or {}}}".format(
field_domain,
self.default_value or "''")
field_domain, self.default_value or "''"
)
# compute the dynamic content for mako expression
@api.multi
@@ -61,9 +62,7 @@ class AgreementClause(models.Model):
MailTemplates = self.env["mail.template"]
for clause in self:
lang = (
clause.agreement_id
and clause.agreement_id.partner_id.lang
or "en_US"
clause.agreement_id and clause.agreement_id.partner_id.lang or "en_US"
)
content = MailTemplates.with_context(lang=lang)._render_template(
clause.content, "agreement.clause", clause.id

View File

@@ -17,11 +17,8 @@ class AgreementIncreaseType(models.Model):
"the contract.",
)
description = fields.Text(
string="Description",
required=True,
help="Description of the renewal type."
string="Description", required=True, help="Description of the renewal type."
)
increase_percent = fields.Integer(
string="Increase Percentage",
help="Percentage that the amount will increase."
string="Increase Percentage", help="Percentage that the amount will increase."
)

View File

@@ -8,21 +8,11 @@ class AgreementLine(models.Model):
_name = "agreement.line"
_description = "Agreement Lines"
product_id = fields.Many2one(
"product.product",
string="Product")
name = fields.Char(
string="Description",
required=True)
agreement_id = fields.Many2one(
"agreement",
string="Agreement",
ondelete="cascade")
product_id = fields.Many2one("product.product", string="Product")
name = fields.Char(string="Description", required=True)
agreement_id = fields.Many2one("agreement", string="Agreement", ondelete="cascade")
qty = fields.Float(string="Quantity")
uom_id = fields.Many2one(
"uom.uom",
string="Unit of Measure",
required=True)
uom_id = fields.Many2one("uom.uom", string="Unit of Measure", required=True)
@api.onchange("product_id")
def _onchange_product_id(self):

View File

@@ -11,32 +11,36 @@ class AgreementRecital(models.Model):
name = fields.Char(string="Name", required=True)
title = fields.Char(
string="Title",
help="The title is displayed on the PDF." "The name is not.")
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")
dynamic_content = fields.Html(
compute="_compute_dynamic_content",
string="Dynamic Content",
help="compute dynamic Content")
agreement_id = fields.Many2one(
"agreement", string="Agreement", ondelete="cascade")
help="compute dynamic 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.")
"removing it.",
)
# Dynamic field editor
field_domain = fields.Char(string='Field Expression',
default='[["active", "=", True]]')
field_domain = fields.Char(
string="Field Expression", default='[["active", "=", True]]'
)
default_value = fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty.")
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.""")
template field.""",
)
@api.onchange("field_domain", "default_value")
def onchange_copyvalue(self):
@@ -46,8 +50,8 @@ class AgreementRecital(models.Model):
if string_list:
field_domain = string_list[0][3:-1]
self.copyvalue = "${{object.{} or {}}}".format(
field_domain,
self.default_value or "''")
field_domain, self.default_value or "''"
)
# compute the dynamic content for mako expression
@api.multi
@@ -55,9 +59,9 @@ class AgreementRecital(models.Model):
MailTemplates = self.env["mail.template"]
for recital in self:
lang = (
recital.agreement_id
and recital.agreement_id.partner_id.lang
or "en_US")
recital.agreement_id and recital.agreement_id.partner_id.lang or "en_US"
)
content = MailTemplates.with_context(lang=lang)._render_template(
recital.content, "agreement.recital", recital.id)
recital.content, "agreement.recital", recital.id
)
recital.dynamic_content = content

View File

@@ -17,7 +17,5 @@ class AgreementRenewalType(models.Model):
"agreement/contract expires.",
)
description = fields.Text(
string="Description",
required=True,
help="Description of the renewal type."
string="Description", required=True, help="Description of the renewal type."
)

View File

@@ -11,34 +11,39 @@ class AgreementSection(models.Model):
name = fields.Char(string="Name", required=True)
title = fields.Char(
string="Title",
help="The title is displayed on the PDF. The name is not.")
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", ondelete="cascade")
agreement_id = fields.Many2one("agreement", string="Agreement", ondelete="cascade")
clauses_ids = fields.One2many(
"agreement.clause", "section_id", string="Clauses", copy=True)
"agreement.clause", "section_id", string="Clauses", copy=True
)
content = fields.Html(string="Section Content")
dynamic_content = fields.Html(
compute="_compute_dynamic_content",
string="Dynamic Content",
help="compute dynamic Content")
help="compute dynamic Content",
)
active = fields.Boolean(
string="Active",
default=True,
help="If unchecked, it will allow you to hide the agreement without "
"removing it.")
"removing it.",
)
# Dynamic field editor
field_domain = fields.Char(string='Field Expression',
default='[["active", "=", True]]')
field_domain = fields.Char(
string="Field Expression", default='[["active", "=", True]]'
)
default_value = fields.Char(
string="Default Value",
help="Optional value to use if the target field is empty.")
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.""")
template field.""",
)
@api.onchange("field_domain", "default_value")
def onchange_copyvalue(self):
@@ -48,16 +53,18 @@ class AgreementSection(models.Model):
if string_list:
field_domain = string_list[0][3:-1]
self.copyvalue = "${{object.{} or {}}}".format(
field_domain,
self.default_value or "''")
field_domain, self.default_value or "''"
)
# compute the dynamic content for mako expression
@api.multi
def _compute_dynamic_content(self):
MailTemplates = self.env["mail.template"]
for section in self:
lang = (section.agreement_id and
section.agreement_id.partner_id.lang or "en_US")
lang = (
section.agreement_id and section.agreement_id.partner_id.lang or "en_US"
)
content = MailTemplates.with_context(lang=lang)._render_template(
section.content, "agreement.section", section.id)
section.content, "agreement.section", section.id
)
section.dynamic_content = content

View File

@@ -11,21 +11,14 @@ class AgreementStage(models.Model):
_order = "sequence"
# General
name = fields.Char(
string="Stage Name",
required=True)
description = fields.Text(
string="Description",
required=False)
sequence = fields.Integer(
string="Sequence",
default="1",
required=False)
name = fields.Char(string="Stage Name", required=True)
description = fields.Text(string="Description", required=False)
sequence = fields.Integer(string="Sequence", default="1", required=False)
fold = fields.Boolean(
string="Is Folded",
required=False,
help="This stage is folded in the kanban view by default.",
)
stage_type = fields.Selection(
[('agreement', 'Agreement')],
string='Type', required=True)
[("agreement", "Agreement")], string="Type", required=True
)

View File

@@ -9,6 +9,4 @@ class AgreementSubtype(models.Model):
_description = "Agreement Subtypes"
name = fields.Char(string="Name", required=True)
agreement_type_id = fields.Many2one(
"agreement.type",
string="Agreement Type")
agreement_type_id = fields.Many2one("agreement.type", string="Agreement Type")

View File

@@ -9,7 +9,5 @@ class AgreementType(models.Model):
_description = "Agreement Types"
agreement_subtypes_ids = fields.One2many(
"agreement.subtype",
"agreement_type_id",
string="Subtypes"
"agreement.subtype", "agreement_type_id", string="Subtypes"
)

View File

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

View File

@@ -19,8 +19,7 @@ class ResConfigSettings(models.TransientModel):
module_agreement_repair = fields.Boolean(
string="Link your repair orders to an agreement."
)
module_agreement_rma = fields.Boolean(
string="Link your RMAs to an agreement.")
module_agreement_rma = fields.Boolean(string="Link your RMAs to an agreement.")
module_agreement_sale = fields.Boolean(
string="Create an agreement when the sale order is confirmed."
)

View File

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

View File

@@ -1,54 +1,61 @@
<?xml version="1.0"?>
<?xml version="1.0" ?>
<odoo>
<report
id="partner_agreement_contract_document"
model="agreement"
string="Contract Document"
name="agreement_legal.report_agreement_document"
file="agreement_legal.report_agreement_document"
report_type="qweb-pdf"/>
id="partner_agreement_contract_document"
model="agreement"
string="Contract Document"
name="agreement_legal.report_agreement_document"
file="agreement_legal.report_agreement_document"
report_type="qweb-pdf"
/>
<report
id="partner_agreement_contract_document_preview"
model="agreement"
string="Contract Document Preview"
name="agreement_legal.report_agreement_document"
file="agreement_legal.report_agreement_document"
report_type="qweb-html"/>
id="partner_agreement_contract_document_preview"
model="agreement"
string="Contract Document Preview"
name="agreement_legal.report_agreement_document"
file="agreement_legal.report_agreement_document"
report_type="qweb-html"
/>
<template id="report_agreement_document">
<t t-name="agreement.report_agreement_document">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="web.external_layout">
<div class="page">
<h1 t-field="doc.name"/>
<h1 t-field="doc.name" />
<div name="description">
<span t-field="doc.dynamic_description"/>
<span t-field="doc.dynamic_description" />
</div>
<h2>Parties</h2>
<div name="parties">
<t t-if="doc.use_parties_content">
<p t-field="doc.dynamic_parties"/>
<p t-field="doc.dynamic_parties" />
</t>
</div>
<t t-if="not doc.use_parties_content">
<h3>Company Information</h3>
<div name="company_address">
<address t-field="doc.company_id.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<address
t-field="doc.company_id.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'
/>
</div>
<div name="company_contact">
Represented by <span t-field="doc.company_contact_id.name"/>.
Represented by <span
t-field="doc.company_contact_id.name"
/>.
</div>
<h3>Partner Information</h3>
<div name="partner_address">
<address t-field="doc.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
<address
t-field="doc.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'
/>
</div>
<div name="partner_contact">
Represented by <span t-field="doc.partner_contact_id.name"/>.
Represented by <span
t-field="doc.partner_contact_id.name"
/>.
</div>
</t>
<h2>Agreement</h2>
@@ -58,11 +65,14 @@
<tr>
<td>
<ol>
<li t-foreach="doc.recital_ids" t-as="r">
<li
t-foreach="doc.recital_ids"
t-as="r"
>
<t t-if="r.title">
<h3 t-field="r.title"/>
<h3 t-field="r.title" />
</t>
<p t-field="r.dynamic_content"/>
<p t-field="r.dynamic_content" />
</li>
</ol>
</td>
@@ -74,17 +84,25 @@
<tr>
<td>
<ol>
<li t-foreach="doc.sections_ids" t-as="s">
<li
t-foreach="doc.sections_ids"
t-as="s"
>
<t t-if="s.title">
<h3 t-field="s.title"/>
<h3 t-field="s.title" />
</t>
<p t-field="s.dynamic_content"/>
<p t-field="s.dynamic_content" />
<ol>
<li t-foreach="s.clauses_ids" t-as="c">
<li
t-foreach="s.clauses_ids"
t-as="c"
>
<t t-if="c.title">
<h4 t-field="c.title"/>
<h4 t-field="c.title" />
</t>
<p t-field="c.dynamic_content"/>
<p
t-field="c.dynamic_content"
/>
</li>
</ol>
</li>
@@ -96,7 +114,7 @@
<t t-if="doc.special_terms">
<h2>Special Terms</h2>
<div name="special_term">
<p t-field="doc.dynamic_special_terms"/>
<p t-field="doc.dynamic_special_terms" />
</div>
</t>
<h2>Signatures</h2>
@@ -110,24 +128,32 @@
<tbody class="section_tbody">
<tr>
<td>
<p t-field="doc.partner_id"/>
<p t-field="doc.partner_id" />
<p>By: </p>
<p>
Name: <span t-field="doc.partner_contact_id.name"/>
Name: <span
t-field="doc.partner_contact_id.name"
/>
</p>
<p>
Title: <span t-field="doc.partner_contact_id.function"/>
Title: <span
t-field="doc.partner_contact_id.function"
/>
</p>
<p>Date: </p>
</td>
<td>
<p t-field="doc.company_id.partner_id"/>
<p t-field="doc.company_id.partner_id" />
<p>By: </p>
<p>
Name: <span t-field="doc.company_contact_id.name"/>
Name: <span
t-field="doc.company_contact_id.name"
/>
</p>
<p>
Title: <span t-field="doc.company_contact_id.function"/>
Title: <span
t-field="doc.company_contact_id.function"
/>
</p>
<p>Date: </p>
</td>
@@ -137,9 +163,11 @@
</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.dynamic_content"/>
<h1
t-field="a.title"
style="page-break-before: always;"
/>
<p t-field="a.dynamic_content" />
</div>
</div>
</t>
@@ -147,5 +175,4 @@
</t>
</t>
</template>
</odoo>

View File

@@ -1,30 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="module_agreement_legal_category" model="ir.module.category">
<field name ="name">Agreement</field>
<field name ="sequence">17</field>
</record>
<field name="name">Agreement</field>
<field name="sequence">17</field>
</record>
<!-- Readonly group -->
<record id="group_agreement_readonly" model="res.groups">
<field name="name">Read-Only Users</field>
<field name="category_id" ref="module_agreement_legal_category"/>
<field name="implied_ids" eval="[(4, ref('base.group_user')), (4, ref('agreement.group_use_agreement_type')), (4, ref('agreement.group_use_agreement_template'))]"/>
<field name="category_id" ref="module_agreement_legal_category" />
<field
name="implied_ids"
eval="[(4, ref('base.group_user')), (4, ref('agreement.group_use_agreement_type')), (4, ref('agreement.group_use_agreement_template'))]"
/>
</record>
<!-- User group -->
<record id="group_agreement_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="module_agreement_legal_category"/>
<field name="implied_ids" eval="[(4, ref('group_agreement_readonly'))]"/>
<field name="category_id" ref="module_agreement_legal_category" />
<field name="implied_ids" eval="[(4, ref('group_agreement_readonly'))]" />
</record>
<!-- Manager group -->
<record id="group_agreement_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="module_agreement_legal_category"/>
<field name="implied_ids" eval="[(4, ref('group_agreement_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
<field name="category_id" ref="module_agreement_legal_category" />
<field name="implied_ids" eval="[(4, ref('group_agreement_user'))]" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>
</odoo>

View File

@@ -1,10 +1,10 @@
odoo.define('agreement_legal.domain_widget_ext', function (require) {
'use strict';
odoo.define("agreement_legal.domain_widget_ext", function(require) {
"use strict";
var basic_fields = require('web.basic_fields');
var DomainSelector = require('web.DomainSelector');
var session = require('web.session');
var core = require('web.core');
var basic_fields = require("web.basic_fields");
var DomainSelector = require("web.DomainSelector");
var session = require("web.session");
var core = require("web.core");
var qweb = core.qweb;
var _t = core._t;
@@ -12,22 +12,22 @@ odoo.define('agreement_legal.domain_widget_ext', function (require) {
/**
* Init
*/
init : function () {
init: function() {
this._super.apply(this, arguments);
// Add Additional options
this.partialUse = this.nodeOptions.partial_use || false;
},
//----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Private
//----------------------------------------------------------------------
// ----------------------------------------------------------------------
/**
* @private
* @override _render from AbstractField
* @returns {Deferred}
*/
_render: function () {
_render: function() {
// If there is no model, only change the non-domain-selector content
if (!this._domainModel) {
this._replaceContent();
@@ -42,12 +42,16 @@ odoo.define('agreement_legal.domain_widget_ext', function (require) {
var def;
if (!this.domainSelector) {
this.domainSelector = new DomainSelector(
this, this._domainModel, value, {
this,
this._domainModel,
value,
{
readonly: this.mode === "readonly" || this.inDialog,
filters: this.fsFilters,
debugMode: session.debug,
partialUse: this.partialUse || false,
});
}
);
def = this.domainSelector.prependTo(this.$el);
} else {
def = this.domainSelector.setDomain(value);
@@ -63,17 +67,19 @@ odoo.define('agreement_legal.domain_widget_ext', function (require) {
*
* @private
*/
_replaceContent: function () {
_replaceContent: function() {
if (this._$content) {
this._$content.remove();
}
this._$content = $(qweb.render("FieldDomain.content", {
hasModel: !!this._domainModel,
isValid: !!this._isValidForModel,
nbRecords: this.record.specialData[this.name].nbRecords || 0,
inDialogEdit: this.inDialog && this.mode === "edit",
partialUse: this.partialUse || false,
}));
this._$content = $(
qweb.render("FieldDomain.content", {
hasModel: Boolean(this._domainModel),
isValid: Boolean(this._isValidForModel),
nbRecords: this.record.specialData[this.name].nbRecords || 0,
inDialogEdit: this.inDialog && this.mode === "edit",
partialUse: this.partialUse || false,
})
);
this._$content.appendTo(this.$el);
},
});

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<templates id="template" xml:space="preserve">
<t t-name="FieldDomain.content">
<t t-if="partialUse">
@@ -18,114 +18,205 @@
</t>
<t t-if="!partialUse">
<div t-if="hasModel" class="o_field_domain_panel">
<i class="fa fa-arrow-right" role="img" aria-label="Domain" title="Domain"/>
<button t-if="isValid" class="btn btn-sm btn-secondary o_domain_show_selection_button" type="button">
<t t-esc="nbRecords"/> record(s)
<i
class="fa fa-arrow-right"
role="img"
aria-label="Domain"
title="Domain"
/>
<button
t-if="isValid"
class="btn btn-sm btn-secondary o_domain_show_selection_button"
type="button"
>
<t t-esc="nbRecords" /> record(s)
</button>
<span t-else="" class="text-warning" role="alert"><i class="fa fa-exclamation-triangle" role="img" aria-label="Warning" title="Warning"/> Invalid domain</span>
<button t-if="inDialogEdit" class="btn btn-sm btn-primary o_field_domain_dialog_button">Edit Domain</button>
<span t-else="" class="text-warning" role="alert"><i
class="fa fa-exclamation-triangle"
role="img"
aria-label="Warning"
title="Warning"
/> Invalid domain</span>
<button
t-if="inDialogEdit"
class="btn btn-sm btn-primary o_field_domain_dialog_button"
>Edit Domain</button>
</div>
<div t-else="">Select a model to add a filter.</div>
</t>
</t>
<div aria-atomic="true" t-name="DomainSelector" t-attf-class="o_domain_node o_domain_tree o_domain_selector #{widget.readonly ? 'o_read_mode' : 'o_edit_mode'}">
<div
aria-atomic="true"
t-name="DomainSelector"
t-attf-class="o_domain_node o_domain_tree o_domain_selector #{widget.readonly ? 'o_read_mode' : 'o_edit_mode'}"
>
<t t-if="widget.options.partialUse">
<t t-if="widget.children.length === 0">
<span>SMatch <strong>all records</strong></span>
<button t-if="!widget.readonly" class="btn btn-sm btn-primary o_domain_add_first_node_button"><i class="fa fa-plus"/> Add filter</button>
<button
t-if="!widget.readonly"
class="btn btn-sm btn-primary o_domain_add_first_node_button"
><i class="fa fa-plus" /> Add filter</button>
</t>
<t t-else="">
<div class="o_domain_tree_header">
<t t-if="widget.children.length === 1">Please navigate below and select field:</t>
<t
t-if="widget.children.length === 1"
>Please navigate below and select field:</t>
<t t-else="">
<span>SSMatch records with</span>
<t t-call="DomainTree.OperatorSelector"/>
<t t-call="DomainTree.OperatorSelector" />
<span>of the following rules:</span>
</t>
</div>
<div class="o_domain_node_children_container"/>
<div class="o_domain_node_children_container" />
</t>
</t>
<t t-if="!widget.options.partialUse">
<t t-if="widget.children.length === 0">
<span>Match <strong>all records</strong></span>
<button t-if="!widget.readonly" class="btn btn-sm btn-primary o_domain_add_first_node_button"><i class="fa fa-plus"/> Add filter</button>
<button
t-if="!widget.readonly"
class="btn btn-sm btn-primary o_domain_add_first_node_button"
><i class="fa fa-plus" /> Add filter</button>
</t>
<t t-else="">
<div class="o_domain_tree_header">
<t t-if="widget.children.length === 1">Match records with the following rule:</t>
<t
t-if="widget.children.length === 1"
>Match records with the following rule:</t>
<t t-else="">
<span>Match records with</span>
<t t-call="DomainTree.OperatorSelector"/>
<t t-call="DomainTree.OperatorSelector" />
<span>of the following rules:</span>
</t>
</div>
<div class="o_domain_node_children_container"/>
<div class="o_domain_node_children_container" />
</t>
<label t-if="widget.debug &amp;&amp; !widget.readonly" class="o_domain_debug_container">
<label
t-if="widget.debug &amp;&amp; !widget.readonly"
class="o_domain_debug_container"
>
<span class="small"># Code editor</span>
<input type="text" class="o_domain_debug_input"/>
<input type="text" class="o_domain_debug_input" />
</label>
</t>
</div>
<t t-name="DomainNode.ControlPanel">
<t t-if="widget.options.partialUse">
<div t-if="!widget.readonly &amp;&amp; !widget.noControlPanel" class="o_domain_node_control_panel" role="toolbar" aria-label="Domain node">
<div
t-if="!widget.readonly &amp;&amp; !widget.noControlPanel"
class="o_domain_node_control_panel"
role="toolbar"
aria-label="Domain node"
>
</div>
</t>
<t t-if="!widget.options.partialUse">
<div t-if="!widget.readonly &amp;&amp; !widget.noControlPanel" class="o_domain_node_control_panel" role="toolbar" aria-label="Domain node">
<button class="btn o_domain_delete_node_button" title="Delete node" aria-label="Delete node"><i class="fa fa-times"/></button>
<button class="btn o_domain_add_node_button" title="Add node" aria-label="Add node"><i class="fa fa-plus-circle"/></button>
<button class="btn o_domain_add_node_button" title="Add branch" aria-label="Add branch" data-branch="1"><i class="fa fa-ellipsis-h"/></button>
<div
t-if="!widget.readonly &amp;&amp; !widget.noControlPanel"
class="o_domain_node_control_panel"
role="toolbar"
aria-label="Domain node"
>
<button
class="btn o_domain_delete_node_button"
title="Delete node"
aria-label="Delete node"
>
<i class="fa fa-times" />
</button>
<button
class="btn o_domain_add_node_button"
title="Add node"
aria-label="Add node"
>
<i class="fa fa-plus-circle" />
</button>
<button
class="btn o_domain_add_node_button"
title="Add branch"
aria-label="Add branch"
data-branch="1"
>
<i class="fa fa-ellipsis-h" />
</button>
</div>
</t>
</t>
<div t-name="DomainLeaf" t-attf-class="o_domain_node o_domain_leaf o_domain_selector_row #{widget.readonly ? 'o_read_mode' : 'o_edit_mode'}">
<t t-call="DomainNode.ControlPanel"/>
<div
t-name="DomainLeaf"
t-attf-class="o_domain_node o_domain_leaf o_domain_selector_row #{widget.readonly ? 'o_read_mode' : 'o_edit_mode'}"
>
<t t-call="DomainNode.ControlPanel" />
<div t-if="!widget.readonly" class="o_domain_leaf_edition">
<!-- field selector will be instantiated here -->
<t t-if="!widget.options.partialUse">
<div> <!-- used for flex stretching -->
<div>
<!-- used for flex stretching -->
<select class="o_domain_leaf_operator_select o_input">
<option t-foreach="widget.operators" t-as="key"
t-att-value="key"
t-att-selected="widget.displayOperator === key ? 'selected' : None">
<t t-esc="key_value"/>
<option
t-foreach="widget.operators"
t-as="key"
t-att-value="key"
t-att-selected="widget.displayOperator === key ? 'selected' : None"
>
<t t-esc="key_value" />
</option>
</select>
</div>
<div t-attf-class="o_ds_value_cell#{_.contains(['set', 'not set'], widget.displayOperator) ? ' d-none' : ''}">
<div
t-attf-class="o_ds_value_cell#{_.contains(['set', 'not set'], widget.displayOperator) ? ' d-none' : ''}"
>
<t t-if="widget.selectionChoices !== null">
<select class="o_domain_leaf_value_input o_input">
<option t-foreach="widget.selectionChoices" t-as="val"
t-att-value="val[0]"
t-att-selected="_.contains(val, widget.displayValue) ? 'selected' : None">
<t t-esc="val[1]"/>
<option
t-foreach="widget.selectionChoices"
t-as="val"
t-att-value="val[0]"
t-att-selected="_.contains(val, widget.displayValue) ? 'selected' : None"
>
<t t-esc="val[1]" />
</option>
</select>
</t>
<t t-else="">
<t t-if="_.contains(['in', 'not in'], widget.operator)">
<div class="o_domain_leaf_value_input">
<span class="badge badge-pill" t-foreach="widget.displayValue" t-as="val">
<t t-esc="val"/> <i class="o_domain_leaf_value_remove_tag_button fa fa-times" t-att-data-value="val" role="img" aria-label="Remove tag" title="Remove tag"/>
<span
class="badge badge-pill"
t-foreach="widget.displayValue"
t-as="val"
>
<t t-esc="val" />
<i
class="o_domain_leaf_value_remove_tag_button fa fa-times"
t-att-data-value="val"
role="img"
aria-label="Remove tag"
title="Remove tag"
/>
</span>
</div>
<div class="o_domain_leaf_value_tags">
<input placeholder="Add new value" type="text" class="o_input"/>
<button class="btn btn-sm btn-primary fa fa-plus o_domain_leaf_value_add_tag_button" aria-label="Add tag" title="Add tag"/>
<input
placeholder="Add new value"
type="text"
class="o_input"
/>
<button
class="btn btn-sm btn-primary fa fa-plus o_domain_leaf_value_add_tag_button"
aria-label="Add tag"
title="Add tag"
/>
</div>
</t>
<t t-else="">
<input class="o_domain_leaf_value_input o_input" type="text" t-att-value="widget.displayValue"/>
<input
class="o_domain_leaf_value_input o_input"
type="text"
t-att-value="widget.displayValue"
/>
</t>
</t>
</div>
@@ -134,45 +225,85 @@
<div t-else="" class="o_domain_leaf_info">
<!-- field selector will be instantiated here -->
<t t-if="_.isString(widget.value)">
<span class="o_domain_leaf_operator"><t t-esc="widget.operator_mapping[widget.operator]"/></span>
<span class="o_domain_leaf_value text-primary">"<t t-esc="widget.value"/>"</span>
<span class="o_domain_leaf_operator">
<t t-esc="widget.operator_mapping[widget.operator]" />
</span>
<span class="o_domain_leaf_value text-primary">"<t
t-esc="widget.value"
/>"</span>
</t>
<t t-if="_.isArray(widget.value)">
<span class="o_domain_leaf_operator"><t t-esc="widget.operator_mapping[widget.operator]"/></span>
<span class="o_domain_leaf_operator">
<t t-esc="widget.operator_mapping[widget.operator]" />
</span>
<t t-foreach="widget.value" t-as="v">
<span class="o_domain_leaf_value text-primary">"<t t-esc="v"/>"</span>
<span class="o_domain_leaf_value text-primary">"<t
t-esc="v"
/>"</span>
<t t-if="!v_last"> or </t>
</t>
</t>
<t t-if="_.isNumber(widget.value)">
<span class="o_domain_leaf_operator"><t t-esc="widget.operator_mapping[widget.operator]"/></span>
<span class="o_domain_leaf_value text-primary"><t t-esc="widget.value"></t></span>
<span class="o_domain_leaf_operator">
<t t-esc="widget.operator_mapping[widget.operator]" />
</span>
<span class="o_domain_leaf_value text-primary">
<t t-esc="widget.value" />
</span>
</t>
<t t-if="_.isBoolean(widget.value)">
is
<t t-if="widget.operator === '=' &amp;&amp; widget.value === false || widget.operator === '!=' &amp;&amp; widget.value === true">not</t>
<t
t-if="widget.operator === '=' &amp;&amp; widget.value === false || widget.operator === '!=' &amp;&amp; widget.value === true"
>not</t>
set
</t>
</div>
</div>
<div aria-atomic="true" t-name="ModelFieldSelector" t-attf-class="o_field_selector#{!widget.options.readonly ? ' o_edit_mode o_input' : ''}">
<div class="o_field_selector_value" tabindex="0"/>
<div
aria-atomic="true"
t-name="ModelFieldSelector"
t-attf-class="o_field_selector#{!widget.options.readonly ? ' o_edit_mode o_input' : ''}"
>
<div class="o_field_selector_value" tabindex="0" />
<t t-if="!widget.options.partialUse">
<div class="o_field_selector_controls" tabindex="0">
<i role="alert" class="fa fa-exclamation-triangle o_field_selector_warning d-none" title="Invalid field chain" aria-label="Invalid field chain"/>
<i
role="alert"
class="fa fa-exclamation-triangle o_field_selector_warning d-none"
title="Invalid field chain"
aria-label="Invalid field chain"
/>
</div>
</t>
<div t-if="!widget.options.readonly" class="o_field_selector_popover d-none" tabindex="0">
<div
t-if="!widget.options.readonly"
class="o_field_selector_popover d-none"
tabindex="0"
>
<div class="o_field_selector_popover_header text-center">
<i class="fa fa-arrow-left o_field_selector_popover_option o_field_selector_prev_page" title="Previous" role="img" aria-label="Previous"/>
<div class="o_field_selector_title"/>
<i class="fa fa-times o_field_selector_popover_option o_field_selector_close" title="Close" role="img" aria-label="Close"/>
<i
class="fa fa-arrow-left o_field_selector_popover_option o_field_selector_prev_page"
title="Previous"
role="img"
aria-label="Previous"
/>
<div class="o_field_selector_title" />
<i
class="fa fa-times o_field_selector_popover_option o_field_selector_close"
title="Close"
role="img"
aria-label="Close"
/>
</div>
<div class="o_field_selector_popover_body">
<ul class="o_field_selector_page"/>
<ul class="o_field_selector_page" />
</div>
<div t-if="widget.options.debugMode" class="o_field_selector_popover_footer">
<input type="text" class="o_input"/>
<div
t-if="widget.options.debugMode"
class="o_field_selector_popover_footer"
>
<input type="text" class="o_input" />
</div>
</div>
</div>

View File

@@ -1,368 +1,551 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="assets_backend" name="agreement_legal assets"
inherit_id="web.assets_backend">
<template
id="assets_backend"
name="agreement_legal assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<script type="text/javascript"
src="/agreement_legal/static/src/js/domain_widget_ext.js"/>
<script
type="text/javascript"
src="/agreement_legal/static/src/js/domain_widget_ext.js"
/>
</xpath>
</template>
<!-- Agreement List View-->
<record model="ir.ui.view" id="partner_agreement_list_view">
<field name="name">Agreement List</field>
<field name="model">agreement</field>
<field name="arch" type="xml">
<tree string="Agreements" default_order='name'>
<field name="name"/>
<field name="partner_id"/>
<field name="company_id"/>
<field name="parent_agreement_id"/>
<field name="agreement_type_id"/>
<field name="agreement_subtype_id"/>
<field name="active" invisible="1"/>
<field name="name" />
<field name="partner_id" />
<field name="company_id" />
<field name="parent_agreement_id" />
<field name="agreement_type_id" />
<field name="agreement_subtype_id" />
<field name="active" invisible="1" />
</tree>
</field>
</record>
<!-- Agreement Form View -->
<record model="ir.ui.view" id="partner_agreement_form_view">
<field name="name">Agreement Form</field>
<field name="model">agreement</field>
<field name="priority" eval="1"/>
<field name="priority" eval="1" />
<field name="arch" type="xml">
<form string="Agreement">
<header>
<button string="New Version" type="object" name="create_new_version" class="oe_highlight" attrs="{'invisible': [('state', '=', 'active')]}"/>
<button string="New Agreement" type="object" name="create_new_agreement" class="oe_highlight" attrs="{'invisible': [('is_template', '=', False)]}"/>
<field name="stage_id" widget="statusbar" clickable="True" options="{'fold_field': 'fold'}" domain="[('stage_type', '=', 'agreement')]"/>
<button
string="New Version"
type="object"
name="create_new_version"
class="oe_highlight"
attrs="{'invisible': [('state', '=', 'active')]}"
/>
<button
string="New Agreement"
type="object"
name="create_new_agreement"
class="oe_highlight"
attrs="{'invisible': [('is_template', '=', False)]}"
/>
<field
name="stage_id"
widget="statusbar"
clickable="True"
options="{'fold_field': 'fold'}"
domain="[('stage_type', '=', 'agreement')]"
/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Agreement Name"/>
<label
for="name"
class="oe_edit_only"
string="Agreement Name"
/>
<h1>
<field name="name"/>
<field name="name" />
</h1>
</div>
<group string="General">
<group>
<field name="code" readonly="1"/>
<field name="parent_agreement_id"
domain="[('partner_id', '=', partner_id)]"/>
<field name="is_template"/>
<field name="code" readonly="1" />
<field
name="parent_agreement_id"
domain="[('partner_id', '=', partner_id)]"
/>
<field name="is_template" />
</group>
<group>
<field name="agreement_type_id"
widget="selection"
required="True"/>
<field name="agreement_subtype_id"
widget="selection"
domain="[('agreement_type_id', '=', agreement_type_id)]"/>
<field name="assigned_user_id"
attrs="{'invisible': [('is_template', '=', True)], 'readonly':[('is_template', '=', True)]}"/>
<field name="active" invisible="1"/>
<field name="state" invisible="1"/>
<field
name="agreement_type_id"
widget="selection"
required="True"
/>
<field
name="agreement_subtype_id"
widget="selection"
domain="[('agreement_type_id', '=', agreement_type_id)]"
/>
<field
name="assigned_user_id"
attrs="{'invisible': [('is_template', '=', True)], 'readonly':[('is_template', '=', True)]}"
/>
<field name="active" invisible="1" />
<field name="state" invisible="1" />
</group>
</group>
<group string="Description">
<field name="description"
required="True"
nolabel="1"/>
<field name="description" required="True" nolabel="1" />
</group>
<group class="oe_edit_only">
<field name="field_domain" widget="domain" nolabel="1"
options="{'model': 'agreement',
'partial_use': True}" />
<field
name="field_domain"
widget="domain"
nolabel="1"
options="{'model': 'agreement',
'partial_use': True}"
/>
<group>
<field name="default_value"/>
<field name="copyvalue"/>
<field name="default_value" />
<field name="copyvalue" />
</group>
<p>
This section (on the left) allows you to add dynamic fields inside the description and special terms.
<ol>
<li>Select the agreement field using the popup</li>
<li>Enter the default value if the field is empty</li>
<li>Copy and paste the placeholder expression in the description or the special terms</li>
<li
>Copy and paste the placeholder expression in the description or the special terms</li>
</ol>
</p>
</group>
<group name="parties" string="Parties">
<group name="cust_parties">
<field name="use_parties_content" string="Use custom content" />
<field
name="use_parties_content"
string="Use custom content"
/>
</group>
<group name="cust_parties">
<p>
This section (on the left) allows you to replace the default listing of the parties with custom dynamic content.
</p>
</group>
<group name="partner"
string="Partner">
<group name="partner" string="Partner">
<div class="o_address_format">
<field name="partner_id"
domain="['|',('customer', '=', True),('supplier', '=', True)]"
context="{'show_address': 1}"
options="{&quot;always_reload&quot;: True}"/>
<field
name="partner_id"
domain="['|',('customer', '=', True),('supplier', '=', True)]"
context="{'show_address': 1}"
options="{&quot;always_reload&quot;: True}"
/>
</div>
</group>
<group name="company"
string="Company">
<group name="company" string="Company">
<div class="o_address_format">
<field name="company_id"
readonly="1"
context="{'show_address': 1}"
options="{&quot;always_reload&quot;: True}"/>
<field
name="company_id"
readonly="1"
context="{'show_address': 1}"
options="{&quot;always_reload&quot;: True}"
/>
</div>
<field name="company_partner_id" invisible="1" />
</group>
<group name="partner_left" string="Primary Contact">
<field name="partner_contact_id" domain="[('parent_id', '=', partner_id)]" nolabel="1"/>
<field name="partner_contact_phone" widget="phone" readonly="1" nolabel="1"/>
<field name="partner_contact_email" widget="email" readonly="1" nolabel="1"/>
<field
name="partner_contact_id"
domain="[('parent_id', '=', partner_id)]"
nolabel="1"
/>
<field
name="partner_contact_phone"
widget="phone"
readonly="1"
nolabel="1"
/>
<field
name="partner_contact_email"
widget="email"
readonly="1"
nolabel="1"
/>
</group>
<group name="contact_right" string="Primary Contact">
<field name="company_contact_id" domain="[('parent_id', '=', company_partner_id)]" nolabel="1"/>
<field name="company_contact_phone" widget="phone" readonly="1" nolabel="1"/>
<field name="company_contact_email" widget="email" readonly="1" nolabel="1"/>
<field
name="company_contact_id"
domain="[('parent_id', '=', company_partner_id)]"
nolabel="1"
/>
<field
name="company_contact_phone"
widget="phone"
readonly="1"
nolabel="1"
/>
<field
name="company_contact_email"
widget="email"
readonly="1"
nolabel="1"
/>
</group>
</group>
<group name="parties_content" string="Parties Content" attrs="{'invisible':[('use_parties_content', '=', False)]}">
<field name="parties" nolabel="1"/>
<group
name="parties_content"
string="Parties Content"
attrs="{'invisible':[('use_parties_content', '=', False)]}"
>
<field name="parties" nolabel="1" />
</group>
<group name="term_information">
<group name="termdates_left" string="Term Dates">
<field name="start_date" attrs="{'required': [('is_template', '=', False)], 'invisible': [('is_template', '=', True)]}"/>
<field name="end_date" attrs="{'required': [('is_template', '=', False)], 'invisible': [('is_template', '=', True)]}"/>
<field name="expiration_notice"/>
<field name="change_notice"/>
<field name="notification_address_id" domain="['|', ('parent_id', '=', partner_id), ('parent_id', '=', company_partner_id)]"/>
<field name="termination_requested"/>
<field name="termination_date"/>
<field
name="start_date"
attrs="{'required': [('is_template', '=', False)], 'invisible': [('is_template', '=', True)]}"
/>
<field
name="end_date"
attrs="{'required': [('is_template', '=', False)], 'invisible': [('is_template', '=', True)]}"
/>
<field name="expiration_notice" />
<field name="change_notice" />
<field
name="notification_address_id"
domain="['|', ('parent_id', '=', partner_id), ('parent_id', '=', company_partner_id)]"
/>
<field name="termination_requested" />
<field name="termination_date" />
</group>
</group>
<group string="Special Terms">
<field name="special_terms"
nolabel="1"/>
<field name="special_terms" nolabel="1" />
</group>
<notebook>
<page name="structure" string="Structure">
<div>
<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"/>
<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>
<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}"/>
<separator string="Clauses"/>
<field name="clauses_ids"
default_order='clause_id, sequence'
nolabel="1"
context="{'default_agreement': active_id}"/>
<separator string="Appendices"/>
<field name="appendix_ids"
default_order='sequence'
nolabel="1"
context="{'default_agreement': active_id}"/>
<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}"
/>
<separator string="Clauses" />
<field
name="clauses_ids"
default_order='clause_id, sequence'
nolabel="1"
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>
<group string="Partner">
<field name="partner_signed_date"/>
<field name="partner_signed_user_id" domain="[('parent_id', '=', partner_id)]"/>
<field name="partner_signed_date" />
<field
name="partner_signed_user_id"
domain="[('parent_id', '=', partner_id)]"
/>
</group>
<group string="Company">
<field name="company_signed_date"/>
<field name="company_signed_user_id"/>
<field name="signed_contract" filename="signed_contract_filename"/>
<field name="signed_contract_filename" invisible="1"/>
<field name="company_signed_date" />
<field name="company_signed_user_id" />
<field
name="signed_contract"
filename="signed_contract_filename"
/>
<field
name="signed_contract_filename"
invisible="1"
/>
</group>
</group>
</page>
<page name="products" string="Products/Services">
<field name="line_ids" nolabel="1">
<tree editable="top">
<field name="product_id"/>
<field name="name"/>
<field name="qty"/>
<field name="uom_id" groups="uom.group_uom"/>
<field name="product_id" />
<field name="name" />
<field name="qty" />
<field name="uom_id" groups="uom.group_uom" />
</tree>
</field>
</page>
<page name="child_agreements" string="Child Agreements">
<field name="child_agreements_ids">
<tree default_order='version desc'>
<field name="name"/>
<field name="version"/>
<field name="revision"/>
<field name="name" />
<field name="version" />
<field name="revision" />
</tree>
</field>
</page>
<page name="old_versions" string="Revisions">
<field name="previous_version_agreements_ids" string="Previouse Versions">
<field
name="previous_version_agreements_ids"
string="Previouse Versions"
>
<tree default_order='version desc'>
<field name="name"/>
<field name="version"/>
<field name="revision"/>
<field name="name" />
<field name="version" />
<field name="revision" />
</tree>
</field>
</page>
<page name="performance" string="Performance">
<p>This section is a place where financial records will show the current performance of this agreement.</p>
<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>
</notebook>
<group string="Administration">
<div>
<p>Reviewed by <field name="reviewed_user_id" class="oe_inline"/> on <field name="reviewed_date" class="oe_inline"/>.</p>
<p>Approved by <field name="approved_user_id" class="oe_inline"/> on <field name="approved_date" class="oe_inline"/>.</p>
<p>Reviewed by <field
name="reviewed_user_id"
class="oe_inline"
/> on <field
name="reviewed_date"
class="oe_inline"
/>.</p>
<p>Approved by <field
name="approved_user_id"
class="oe_inline"
/> on <field
name="approved_date"
class="oe_inline"
/>.</p>
</div>
</group>
<footer>
Version: <field name="version" readonly="True"/>.<field name="revision" readonly="True"/>
| Created By: <field name="create_uid" readonly="True"/>
| Created On: <field name="create_date" readonly="True"/>
Version: <field name="version" readonly="True" />.<field
name="revision"
readonly="True"
/>
| Created By: <field name="create_uid" readonly="True" />
| Created On: <field name="create_date" readonly="True" />
</footer>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<!-- Agreement Kanban View -->
<record id="view_project_agreement_kanban" model="ir.ui.view">
<field name="name">Agreement Kanban</field>
<field name="model">agreement</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id">
<field name="color"/>
<field name="assigned_user_id"/>
<field name="color" />
<field name="assigned_user_id" />
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
<div
t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click"
>
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
</strong><br/>
<div class="o_kanban_record_subtitle text-muted">
<field name="partner_id" invisible="context.get('default_partner_id', False)"/>
<t t-if="record.end_date.raw_value and record.end_date.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t>
<field name="name" />
</strong>
<br />
<div
class="o_kanban_record_subtitle text-muted"
>
<field
name="partner_id"
invisible="context.get('default_partner_id', False)"
/>
<t
t-if="record.end_date.raw_value and record.end_date.raw_value lt (new Date())"
t-set="red"
>oe_kanban_text_red</t>
<div t-attf-class="#{red || ''}">
<i><field name="end_date"/></i>
<i>
<field name="end_date" />
</i>
</div>
</div>
</div>
<div class="o_dropdown_kanban dropdown" groups="base.group_user">
<a role="button" class="dropdown-toggle btn" data-toggle="dropdown" href="#">
<span class="fa fa-ellipsis-v" aria-hidden="true"/>
<div
class="o_dropdown_kanban dropdown"
groups="base.group_user"
>
<a
role="button"
class="dropdown-toggle btn"
data-toggle="dropdown"
href="#"
>
<span
class="fa fa-ellipsis-v"
aria-hidden="true"
/>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li t-if="widget.editable"><a type="edit">Edit</a></li>
<li class="divider"/>
<li class="dropdown-header">Record's Colour</li>
<ul
class="dropdown-menu"
role="menu"
aria-labelledby="dLabel"
>
<li t-if="widget.editable">
<a type="edit">Edit</a>
</li>
<li class="divider" />
<li
class="dropdown-header"
>Record's Colour</li>
<li>
<ul class="oe_kanban_colorpicker" data-field="color"/>
<ul
class="oe_kanban_colorpicker"
data-field="color"
/>
</li>
</ul>
</div>
</div>
<div class="o_kanban_record_body">
<field name="agreement_type_id"/> - <field name="agreement_subtype_id"/>
<field name="agreement_type_id" /> - <field
name="agreement_subtype_id"
/>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
V: <field name="version"/>
V: <field name="version" />
</div>
<div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.assigned_user_id.raw_value)" t-att-title="record.assigned_user_id.value" width="36" height="36" class="oe_kanban_avatar" alt="user &amp; picture"/>
<img
t-att-src="kanban_image('res.users', 'image_small', record.assigned_user_id.raw_value)"
t-att-title="record.assigned_user_id.value"
width="36"
height="36"
class="oe_kanban_avatar"
alt="user &amp; picture"
/>
</div>
</div>
</div>
<div class="oe_clear"/>
<div class="oe_clear" />
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Agreement Search View -->
<record model="ir.ui.view" id="partner_agreement_search_view">
<field name="name">Agreement Search</field>
<field name="model">agreement</field>
<field name="arch" type="xml">
<search string="Agreement Search">
<field name="name"/>
<field name="partner_id"/>
<field name="agreement_type_id"/>
<field name="agreement_subtype_id"/>
<filter name="filter_non_template" string="Non-Templates" domain="[('active','=',True),('is_template', '=', False)]"/>
<filter name="filter_inactive" string="Archived" domain="[('active','=',False)]"/>
<filter name="filter_templates" string="Templates" domain="[('active','=',True),('is_template', '=', True)]"/>
<filter name="group_partner_id" string="Partners" icon="terp-partner" context="{'group_by':'partner_id'}"/>
<filter name="group_status" string="Status" icon="terp-partner" context="{'group_by':'state'}"/>
<field name="name" />
<field name="partner_id" />
<field name="agreement_type_id" />
<field name="agreement_subtype_id" />
<filter
name="filter_non_template"
string="Non-Templates"
domain="[('active','=',True),('is_template', '=', False)]"
/>
<filter
name="filter_inactive"
string="Archived"
domain="[('active','=',False)]"
/>
<filter
name="filter_templates"
string="Templates"
domain="[('active','=',True),('is_template', '=', True)]"
/>
<filter
name="group_partner_id"
string="Partners"
icon="terp-partner"
context="{'group_by':'partner_id'}"
/>
<filter
name="group_status"
string="Status"
icon="terp-partner"
context="{'group_by':'state'}"
/>
</search>
</field>
</record>
<!-- Agreement Reporting -->
<record id="agreement_graph_view" model="ir.ui.view">
<field name="name">agreement.graph</field>
<field name="model">agreement</field>
<field name="arch" type="xml">
<graph string="Agreements" type="bar">
<field name="stage_id" type="row"/>
<field name="stage_id" type="row" />
</graph>
</field>
</record>
<record id="agreement_pivot_view" model="ir.ui.view">
<field name="name">agreement.pivot</field>
<field name="model">agreement</field>
<field name="arch" type="xml">
<pivot string="Agreements" display_quantity="true">
<field name="stage_id" type="row"/>
<field name="stage_id" type="row" />
</pivot>
</field>
</record>
<record id="action_agreement_report_order" model="ir.actions.act_window">
<field name="name">Agreements</field>
<field name="res_model">agreement</field>
<field name="view_type">form</field>
<field name="view_mode">graph,pivot</field>
</record>
<!-- actions opening views on models -->
<record model="ir.actions.act_window" id="agreement_dashboard_agreement">
<field name="name">Agreements</field>
<field name="res_model">agreement</field>
<field name="domain">[('is_template', '=', False)]</field>
<field name="view_mode">kanban,tree,form</field>
</record>
<record model="ir.actions.act_window" id="agreement_operations_agreement">
<field name="name">Agreements</field>
<field name="res_model">agreement</field>
<field name="domain">[('is_template', '=', False)]</field>
<field name="view_mode">tree,form</field>
</record>
<record model="ir.actions.act_window" id="partner_agreement_agreement_templates">
<field name="name">Templates</field>
<field name="res_model">agreement</field>
@@ -370,5 +553,4 @@
<!-- <field name="context">[('is_template', '=', True)]</field> -->
<field name="view_mode">tree,kanban,form</field>
</record>
</odoo>

View File

@@ -1,22 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<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"/>
<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>
@@ -25,38 +22,54 @@
<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
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>
<label for="name" class="oe_edit_only" />
<h1>
<field name="name" />
</h1>
</div>
<group>
<group>
<field name="title"/>
<field name="agreement_id"/>
<field name="title" />
<field name="agreement_id" />
</group>
<group>
<field name="sequence"/>
<field name="sequence" />
</group>
</group>
<field name="content" widget="html"/>
<field name="content" widget="html" />
<group class="oe_edit_only">
<field name="field_domain" widget="domain" nolabel="1"
options="{'model': 'agreement.appendix',
'partial_use': True}" />
<field
name="field_domain"
widget="domain"
nolabel="1"
options="{'model': 'agreement.appendix',
'partial_use': True}"
/>
<group>
<field name="default_value"/>
<field name="copyvalue"/>
<field name="default_value" />
<field name="copyvalue" />
</group>
<p>
This section (on the left) allows you to add dynamic fields inside the content.
<ol>
<li>Select the field using the popup</li>
<li>Enter the default value if the field is empty</li>
<li>Copy and paste the placeholder expression in the content</li>
<li
>Copy and paste the placeholder expression in the content</li>
</ol>
</p>
</group>
@@ -64,23 +77,24 @@
</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'}"/>
<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>

View File

@@ -1,22 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- 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 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="active" invisible="1"/>
<field name="sequence" widget="handle" />
<field name="name" />
<field name="title" />
<field name="agreement_id" />
<field name="section_id" />
<field name="active" invisible="1" />
</tree>
</field>
</record>
<!-- Agreement Clause Form View -->
<record model="ir.ui.view" id="partner_agreement_clause_form_view">
<field name="name">Agreement clause Form</field>
@@ -25,39 +23,58 @@
<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
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>
<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="title" />
<field name="agreement_id" />
<field
name="section_id"
domain="[('agreement_id', '=', agreement_id)]"
/>
</group>
<group>
<field name="sequence"/>
<field name="sequence" />
</group>
</group>
<field name="content" widget="html"/>
<field name="content" widget="html" />
<group class="oe_edit_only">
<field name="field_domain" widget="domain" nolabel="1"
options="{'model': 'agreement.clause',
'partial_use': True}" />
<field
name="field_domain"
widget="domain"
nolabel="1"
options="{'model': 'agreement.clause',
'partial_use': True}"
/>
<group>
<field name="default_value"/>
<field name="copyvalue"/>
<field name="default_value" />
<field name="copyvalue" />
</group>
<p>
This section (on the left) allows you to add dynamic fields inside the content.
<ol>
<li>Select the field using the popup</li>
<li>Enter the default value if the field is empty</li>
<li>Copy and paste the placeholder expression in the content</li>
<li
>Copy and paste the placeholder expression in the content</li>
</ol>
</p>
</group>
@@ -65,24 +82,29 @@
</form>
</field>
</record>
<!-- Agreement Clause Search View -->
<record model="ir.ui.view" id="agreement_clause_search_view">
<field name="name">Agreement Clause Search</field>
<field name="model">agreement.clause</field>
<field name="arch" type="xml">
<search string="Agreement Clause Search">
<filter name="group_agreement" icon="terp-partner" context="{'group_by':'agreement_id'}"/>
<filter name="group_section" icon="terp-partner" context="{'group_by':'section_id'}"/>
<filter
name="group_agreement"
icon="terp-partner"
context="{'group_by':'agreement_id'}"
/>
<filter
name="group_section"
icon="terp-partner"
context="{'group_by':'section_id'}"
/>
</search>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_clause">
<field name="name">Clauses</field>
<field name="res_model">agreement.clause</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View File

@@ -1,19 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Agreement Increase Type List View-->
<record model="ir.ui.view" id="partner_agreement_increasetype_list_view">
<field name="name">Agreement Increase Type List</field>
<field name="model">agreement.increasetype</field>
<field name="arch" type="xml">
<tree default_order='name'>
<field name="name"/>
<field name="description"/>
<field name="increase_percent"/>
<field name="name" />
<field name="description" />
<field name="increase_percent" />
</tree>
</field>
</record>
<!-- Agreement Increase Type Form View -->
<record model="ir.ui.view" id="partner_agreement_increasetype_form_view">
<field name="name">Agreement Increase Type Form</field>
@@ -22,24 +20,22 @@
<form string="Agreements Type Form">
<sheet>
<group>
<field name="name"/>
<field name="name" />
</group>
<group>
<field name="increase_percent"/>
<field name="increase_percent" />
</group>
<group string="Description">
<field name="description" nolabel="1"/>
<field name="description" nolabel="1" />
</group>
</sheet>
</form>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_increasetype">
<field name="name">Agreement Increase Type</field>
<field name="res_model">agreement.increasetype</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View File

@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<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"/>
<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>
@@ -24,40 +22,54 @@
<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
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>
<label for="name" class="oe_edit_only" />
<h1>
<field name="name" />
</h1>
</div>
<group>
<group>
<field name="title"/>
<field name="agreement_id"/>
<field name="title" />
<field name="agreement_id" />
</group>
<group>
<field name="sequence"/>
<field name="sequence" />
</group>
</group>
<field name="content" widget="html"/>
<field name="content" widget="html" />
<group class="oe_edit_only">
<field name="field_domain" widget="domain" nolabel="1"
options="{'model': 'agreement.recital',
'partial_use': True}" />
<field
name="field_domain"
widget="domain"
nolabel="1"
options="{'model': 'agreement.recital',
'partial_use': True}"
/>
<group>
<field name="default_value"/>
<field name="copyvalue"/>
<field name="default_value" />
<field name="copyvalue" />
</group>
<p>
This section (on the left) allows you to add dynamic fields inside the content.
<ol>
<li>Select the field using the popup</li>
<li>Enter the default value if the field is empty</li>
<li>Copy and paste the placeholder expression in the content</li>
<li
>Copy and paste the placeholder expression in the content</li>
</ol>
</p>
</group>
@@ -65,23 +77,24 @@
</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'}"/>
<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>

View File

@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Agreement Renewal Type List View-->
<record model="ir.ui.view" id="partner_agreement_renewaltype_list_view">
<field name="name">Agreement Renewal Type List</field>
<field name="model">agreement.renewaltype</field>
<field name="arch" type="xml">
<tree default_order='name'>
<field name="name"/>
<field name="description"/>
<field name="name" />
<field name="description" />
</tree>
</field>
</record>
<!-- Agreement Renewal Type Form View -->
<record model="ir.ui.view" id="partner_agreement_renewaltype_form_view">
<field name="name">Agreement Renewal Type Form</field>
@@ -21,21 +19,19 @@
<form string="Agreements Type Form">
<sheet>
<group>
<field name="name"/>
<field name="name" />
</group>
<group string="Description">
<field name="description" nolabel="1"/>
<field name="description" nolabel="1" />
</group>
</sheet>
</form>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_renewaltype">
<field name="name">Agreement Renewal Type</field>
<field name="res_model">agreement.renewaltype</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View File

@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- 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 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"/>
<field name="sequence" widget="handle" />
<field name="name" />
<field name="title" />
<field name="agreement_id" />
<field name="active" invisible="1" />
</tree>
</field>
</record>
<!-- Agreement Sections Form View -->
<record model="ir.ui.view" id="partner_agreement_section_form_view">
<field name="name">Agreement Section Form</field>
@@ -24,52 +22,71 @@
<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
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>
<label for="name" class="oe_edit_only" />
<h1>
<field name="name" />
</h1>
</div>
<group>
<group>
<field name="title"/>
<field name="agreement_id"/>
<field name="title" />
<field name="agreement_id" />
</group>
<group>
<field name="sequence"/>
<field name="sequence" />
</group>
</group>
<notebook>
<page string="Content">
<field name='content' nolabel="1"/>
<field name='content' nolabel="1" />
<group class="oe_edit_only">
<field name="field_domain" widget="domain" nolabel="1"
options="{'model': 'agreement.section',
'partial_use': True}" />
<field
name="field_domain"
widget="domain"
nolabel="1"
options="{'model': 'agreement.section',
'partial_use': True}"
/>
<group>
<field name="default_value"/>
<field name="copyvalue"/>
<field name="default_value" />
<field name="copyvalue" />
</group>
<p>
This section (on the left) allows you to add dynamic fields inside the content.
<ol>
<li>Select the field using the popup</li>
<li>Enter the default value if the field is empty</li>
<li>Copy and paste the placeholder expression in the content</li>
<li
>Enter the default value if the field is empty</li>
<li
>Copy and paste the placeholder expression in the content</li>
</ol>
</p>
</group>
</page>
<page string="Clauses">
<field name="clauses_ids"
nolabel="1"
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="sequence" widget="handle"/>
<field name="name"/>
<field name="title"/>
<field name="sequence" widget="handle" />
<field name="name" />
<field name="title" />
</tree>
</field>
</page>
@@ -78,23 +95,25 @@
</form>
</field>
</record>
<!-- Agreement Section Search View -->
<record model="ir.ui.view" id="partner_agreement_section_search_view">
<field name="name">Agreement Section Search</field>
<field name="model">agreement.section</field>
<field name="arch" type="xml">
<search string="Agreement Section Search">
<filter name="group_agreement" string="Agreements" icon="terp-partner" context="{'group_by':'agreement_id'}"/>
<filter
name="group_agreement"
string="Agreements"
icon="terp-partner"
context="{'group_by':'agreement_id'}"
/>
</search>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_section">
<field name="name">Agreement Sections</field>
<field name="res_model">agreement.section</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View File

@@ -1,19 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Agreement Stage List View-->
<record model="ir.ui.view" id="partner_agreement_stage_list_view">
<field name="name">Agreement Stage List</field>
<field name="model">agreement.stage</field>
<field name="arch" type="xml">
<tree default_order='sequence, name'>
<field name="sequence" widget="handle"/>
<field name="name" string="Stage Name"/>
<field name="stage_type"/>
<field name="sequence" widget="handle" />
<field name="name" string="Stage Name" />
<field name="stage_type" />
</tree>
</field>
</record>
<!-- Agreement Stage Form View -->
<record model="ir.ui.view" id="partner_agreement_stage_form_view">
<field name="name">Agreement Stage Form</field>
@@ -22,24 +20,24 @@
<form string="Agreements Stage Form">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Stage Name"/>
<h1><field name="name" string="Stage Name"/></h1>
<label for="name" class="oe_edit_only" string="Stage Name" />
<h1>
<field name="name" string="Stage Name" />
</h1>
</div>
<group>
<field name="sequence"/>
<field name="stage_type"/>
<field name="fold"/>
<field name="sequence" />
<field name="stage_type" />
<field name="fold" />
</group>
</sheet>
</form>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_stage">
<field name="name">Agreement Stage</field>
<field name="res_model">agreement.stage</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View File

@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Agreement Sub Type List View-->
<record model="ir.ui.view" id="partner_agreement_subtype_list_view">
<field name="name">Agreement Subtype List</field>
<field name="model">agreement.subtype</field>
<field name="arch" type="xml">
<tree default_order='name'>
<field name="name" string="Sub-Type Name"/>
<field name="agreement_type_id" string="Agreement Type"/>
<field name="name" string="Sub-Type Name" />
<field name="agreement_type_id" string="Agreement Type" />
</tree>
</field>
</record>
<!-- Agreement Sub Type Form View -->
<record model="ir.ui.view" id="partner_agreement_subtype_form_view">
<field name="name">Agreement Sub Type Form</field>
@@ -21,25 +19,25 @@
<form string="Agreement Sub-Types">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
<label for="name" class="oe_edit_only" />
<h1>
<field name="name" />
</h1>
</div>
<group>
<group>
<field name="agreement_type_id"/>
</group>
<group></group>
<field name="agreement_type_id" />
</group>
<group />
</group>
</sheet>
</form>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_subtype">
<field name="name">Agreement Sub-Types</field>
<field name="res_model">agreement.subtype</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View File

@@ -1,40 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Agreement Type List View-->
<record model="ir.ui.view" id="partner_agreement_type_list_view">
<field name="name">Agreement Type List</field>
<field name="model">agreement.type</field>
<field name="inherit_id" ref="agreement.agreement_type_list_view"/>
<field name="inherit_id" ref="agreement.agreement_type_list_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="agreement_subtypes_ids" string="Sub-Types"/>
<field name="agreement_subtypes_ids" string="Sub-Types" />
</field>
</field>
</field>
</record>
<!-- Agreement Type Form View -->
<record model="ir.ui.view" id="partner_agreement_type_form_view">
<field name="name">Agreement Type Form</field>
<field name="model">agreement.type</field>
<field name="inherit_id" ref="agreement.agreement_type_form_view"/>
<field name="inherit_id" ref="agreement.agreement_type_form_view" />
<field name="arch" type="xml">
<xpath expr="//sheet" position="inside">
<field name="agreement_subtypes_ids"
nolabel="1">
<field name="agreement_subtypes_ids" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="name" />
</tree>
</field>
</xpath>
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="partner_agreement_action_type">
<field name="name">Agreement Types</field>
<field name="res_model">agreement.type</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>

View File

@@ -1,147 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Remove top menu from agreement module -->
<!-- <delete model="ir.ui.menu" id="agreement.agreement_menu" /> -->
<!-- Top menu item -->
<menuitem
name="Agreements"
id="agreement.agreement_menu"
web_icon="agreement_legal,static/description/icon.png"
sequence="80"
action="agreement_dashboard_agreement"
groups="agreement_legal.group_agreement_readonly"/>
name="Agreements"
id="agreement.agreement_menu"
web_icon="agreement_legal,static/description/icon.png"
sequence="80"
action="agreement_dashboard_agreement"
groups="agreement_legal.group_agreement_readonly"
/>
<!-- Dashboard -->
<menuitem
name="Dashboard"
id="agreement_dashboard"
parent="agreement.agreement_menu"
sequence="10"/>
name="Dashboard"
id="agreement_dashboard"
parent="agreement.agreement_menu"
sequence="10"
/>
<menuitem
name="Agreements"
id="dashboard_agreements"
parent="agreement_dashboard"
sequence="10"
action="agreement_dashboard_agreement"/>
name="Agreements"
id="dashboard_agreements"
parent="agreement_dashboard"
sequence="10"
action="agreement_dashboard_agreement"
/>
<!-- Operations -->
<menuitem
name="Operations"
id="agreement_operations"
parent="agreement.agreement_menu"
sequence="20"/>
name="Operations"
id="agreement_operations"
parent="agreement.agreement_menu"
sequence="20"
/>
<menuitem
name="Agreements"
id="operations_agreements"
parent="agreement_operations"
sequence="10"
action="agreement_operations_agreement"/>
name="Agreements"
id="operations_agreements"
parent="agreement_operations"
sequence="10"
action="agreement_operations_agreement"
/>
<!-- Master Data -->
<menuitem
name="Master Data"
id="agreement_masterdata"
parent="agreement.agreement_menu"
sequence="30"/>
name="Master Data"
id="agreement_masterdata"
parent="agreement.agreement_menu"
sequence="30"
/>
<menuitem
name="Contents"
id="agreement_data_contents"
parent="agreement_masterdata"
sequence="10"/>
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"/>
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"/>
name="Clauses"
id="agreement_clauses"
parent="agreement_data_contents"
sequence="20"
action="partner_agreement_action_clause"
/>
<menuitem
name="Sections"
id="agreement_sections"
parent="agreement_data_contents"
sequence="30"
action="partner_agreement_action_section"/>
name="Sections"
id="agreement_sections"
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"/>
name="Appendices"
id="agreement_appendices"
parent="agreement_data_contents"
sequence="40"
action="agreement_appendix_action"
/>
<menuitem
name="Products"
id="agreement_products"
sequence="100"
parent="agreement_masterdata"
action="product.product_template_action"/>
name="Products"
id="agreement_products"
sequence="100"
parent="agreement_masterdata"
action="product.product_template_action"
/>
<!-- Reporting -->
<menuitem
name="Reporting"
id="agreement_reporting"
sequence="40"
parent="agreement.agreement_menu"
groups="agreement_legal.group_agreement_manager"/>
name="Reporting"
id="agreement_reporting"
sequence="40"
parent="agreement.agreement_menu"
groups="agreement_legal.group_agreement_manager"
/>
<menuitem
name="Agreements"
id="agreement_agreement_reporting"
sequence="10"
parent="agreement_reporting"
action="action_agreement_report_order"/>
name="Agreements"
id="agreement_agreement_reporting"
sequence="10"
parent="agreement_reporting"
action="action_agreement_report_order"
/>
<!-- Configuration -->
<menuitem
name="Configuration"
id="agreement_configuration"
sequence="50"
parent="agreement.agreement_menu"
groups="agreement_legal.group_agreement_manager"/>
name="Configuration"
id="agreement_configuration"
sequence="50"
parent="agreement.agreement_menu"
groups="agreement_legal.group_agreement_manager"
/>
<menuitem
name="Settings"
id="agreement_settings"
sequence="10"
parent="agreement_configuration"
action="agreement_legal.action_agreement_config"/>
name="Settings"
id="agreement_settings"
sequence="10"
parent="agreement_configuration"
action="agreement_legal.action_agreement_config"
/>
<menuitem
name="Templates"
id="template"
parent="agreement_configuration"
sequence="20"
action="partner_agreement_agreement_templates"/>
name="Templates"
id="template"
parent="agreement_configuration"
sequence="20"
action="partner_agreement_agreement_templates"
/>
<menuitem
name="Renewal Types"
id="agreement_renewaltype"
parent="agreement_configuration"
sequence="30"
action="partner_agreement_action_renewaltype"/>
name="Renewal Types"
id="agreement_renewaltype"
parent="agreement_configuration"
sequence="30"
action="partner_agreement_action_renewaltype"
/>
<menuitem
name="Increase Types"
id="agreement_increamenttypes"
parent="agreement_configuration"
sequence="31"
action="partner_agreement_action_increasetype"/>
name="Increase Types"
id="agreement_increamenttypes"
parent="agreement_configuration"
sequence="31"
action="partner_agreement_action_increasetype"
/>
<menuitem
name="Stages"
id="agreement_stages"
parent="agreement_configuration"
sequence="40"
action="partner_agreement_action_stage"/>
name="Stages"
id="agreement_stages"
parent="agreement_configuration"
sequence="40"
action="partner_agreement_action_stage"
/>
<menuitem
name="Types"
id="agreement_types"
parent="agreement_configuration"
sequence="50"
action="partner_agreement_action_type"/>
name="Types"
id="agreement_types"
parent="agreement_configuration"
sequence="50"
action="partner_agreement_action_type"
/>
<menuitem
name="Sub-Types"
id="agreement_subtypes"
parent="agreement_configuration"
sequence="60"
action="partner_agreement_action_subtype"/>
name="Sub-Types"
id="agreement_subtypes"
parent="agreement_configuration"
sequence="60"
action="partner_agreement_action_subtype"
/>
</odoo>

View File

@@ -1,32 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.agreement</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="40"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="priority" eval="40" />
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block"
data-string="Agreements"
string="Agreements"
data-key="agreement_legal"
groups="agreement_legal.group_agreement_manager">
<div
class="app_settings_block"
data-string="Agreements"
string="Agreements"
data-key="agreement_legal"
groups="agreement_legal.group_agreement_manager"
>
<h2>Operations</h2>
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="group_uom"/>
<field name="group_uom" />
</div>
<div class="o_setting_right_pane">
<label for="group_uom"/>
<label for="group_uom" />
<div class="text-muted">
Sell and purchase products in different units of measure
</div>
<div class="content-group">
<div class="mt16" attrs="{'invisible': [('group_uom', '=', False)]}">
<button name="%(uom.product_uom_form_action)d" icon="fa-arrow-right" type="action" string="Units Of Measure" class="btn-link"/>
<div
class="mt16"
attrs="{'invisible': [('group_uom', '=', False)]}"
>
<button
name="%(uom.product_uom_form_action)d"
icon="fa-arrow-right"
type="action"
string="Units Of Measure"
class="btn-link"
/>
</div>
</div>
</div>
@@ -36,22 +46,24 @@
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_sale"/>
<field name="module_agreement_sale" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Sales"/>
<label for="" string="Sales" />
<div class="text-muted">
Create an agreement when the sales order is confirmed
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box"
attrs="{'invisible': [('module_agreement_sale', '!=', True)]}">
<div
class="col-xs-12 col-md-6 o_setting_box"
attrs="{'invisible': [('module_agreement_sale', '!=', True)]}"
>
<div class="o_setting_left_pane">
<field name="module_agreement_sale_subscription"/>
<field name="module_agreement_sale_subscription" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Sale Subscriptions"/>
<label for="" string="Sale Subscriptions" />
<div class="text-muted">
Link your subscriptions to an agreement
</div>
@@ -59,10 +71,10 @@
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_fieldservice_agreement"/>
<field name="module_fieldservice_agreement" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Field Service"/>
<label for="" string="Field Service" />
<div class="text-muted">
Link your Field Service orders and equipments to an agreement
</div>
@@ -70,10 +82,10 @@
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_stock"/>
<field name="module_agreement_stock" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Inventory"/>
<label for="" string="Inventory" />
<div class="text-muted">
Link your transfers to an agreement
</div>
@@ -81,10 +93,10 @@
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_rma"/>
<field name="module_agreement_rma" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Returns"/>
<label for="" string="Returns" />
<div class="text-muted">
Link your returns to an agreement
</div>
@@ -92,10 +104,10 @@
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_maintenance"/>
<field name="module_agreement_maintenance" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Maintenance"/>
<label for="" string="Maintenance" />
<div class="text-muted">
Manage maintenance agreements and contracts
</div>
@@ -103,10 +115,10 @@
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_mrp"/>
<field name="module_agreement_mrp" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Manufacturing"/>
<label for="" string="Manufacturing" />
<div class="text-muted">
Link your manufacturing orders to an agreement
</div>
@@ -114,10 +126,10 @@
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_repair"/>
<field name="module_agreement_repair" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Repair"/>
<label for="" string="Repair" />
<div class="text-muted">
Link your repair orders to an agreement
</div>
@@ -125,10 +137,10 @@
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_project"/>
<field name="module_agreement_project" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Project"/>
<label for="" string="Project" />
<div class="text-muted">
Link your projects and tasks to an agreement
</div>
@@ -136,10 +148,10 @@
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_agreement_helpdesk"/>
<field name="module_agreement_helpdesk" />
</div>
<div class="o_setting_right_pane">
<label for="" string="Helpdesk"/>
<label for="" string="Helpdesk" />
<div class="text-muted">
Link your Helpdesk tickets to an agreement
</div>
@@ -150,12 +162,12 @@
</xpath>
</field>
</record>
<act_window id="action_agreement_config"
name="Settings"
res_model="res.config.settings"
view_mode="form"
target="inline"
context="{'module': 'agreement'}"/>
<act_window
id="action_agreement_config"
name="Settings"
res_model="res.config.settings"
view_mode="form"
target="inline"
context="{'module': 'agreement'}"
/>
</odoo>

View File

@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="partner_form">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//page[@name='internal_notes']" position="after">
<page name="agreement" string="Agreements">
<group>
<field name="agreement_ids" nolabel="1"/>
<field name="agreement_ids" nolabel="1" />
</group>
</page>
</xpath>

View File

@@ -0,0 +1 @@
../../../../agreement_legal

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)