Files
contract/agreement_legal/views/agreement_section.xml
2023-10-30 09:07:42 +01:00

157 lines
7.0 KiB
XML

<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>
<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>
<field name="model">agreement.section</field>
<field name="arch" type="xml">
<form string="Section">
<sheet>
<div class="oe_button_box" name="button_box" />
<widget
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
/>
<field name="active" invisible="1" />
<div class="oe_title">
<label for="name" class="oe_edit_only" />
<h1><field name="name" /></h1>
</div>
<group>
<group>
<field name="title" />
<field name="agreement_id" />
</group>
<group>
<field name="sequence" />
</group>
</group>
<notebook>
<page string="Content">
<field name='content' nolabel="1" />
<group class="oe_edit_only">
<group>
<field
name="field_id"
domain="[('model_id', '=', active_model),
('ttype', '!=', 'one2many'),
('ttype', '!=', 'many2many')]"
/>
<field name="sub_object_id" readonly="1" />
<field
name="sub_model_object_field_id"
domain="[('model_id', '=', sub_object_id),
('ttype', '!=', 'one2many'),
('ttype', '!=', 'many2many')]"
attrs="{'readonly':[('sub_object_id', '=', False)],
'required':[('sub_object_id', '!=', False)]}"
/>
<field name="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 section field</li>
<li>Select the sub-field</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}"
>
<tree>
<field name="sequence" widget="handle" />
<field name="name" />
<field name="title" />
</tree>
</field>
</page>
</notebook>
</sheet>
</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="Section">
<field name="name" />
<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>
<!-- Agreement Sections List View 2 (Call this view from agreement)-->
<record model="ir.ui.view" id="partner_agreement_section_list_view2">
<field name="name">Agreement Section List2</field>
<field name="model">agreement.section</field>
<field name="inherit_id" ref="partner_agreement_section_list_view" />
<field name="mode">primary</field>
<field name="priority">999</field>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="default_order">sequence</attribute>
</tree>
<field name="agreement_id" position="attributes">
<attribute name="invisible">1</attribute>
</field>
</field>
</record>
<!-- Agreement Sections Form View 2 (Call this view from agreement)-->
<record model="ir.ui.view" id="partner_agreement_section_form_view2">
<field name="name">Agreement Section Form2</field>
<field name="model">agreement.section</field>
<field name="inherit_id" ref="partner_agreement_section_form_view" />
<field name="mode">primary</field>
<field name="priority">999</field>
<field name="arch" type="xml">
<field name="agreement_id" position="attributes">
<attribute name="invisible">1</attribute>
</field>
</field>
</record>
</odoo>