[IMP] Add dynamic field editor

This commit is contained in:
Maxime Chambreuil
2019-01-08 18:04:26 -06:00
parent 0aa276a2e8
commit 976aabde1d
12 changed files with 387 additions and 153 deletions

View File

@@ -63,13 +63,32 @@
required="True"
nolabel="1"/>
</group>
<div class="oe_edit_only">
<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>
For dynamic content use mako expression '${expression}'. For ex:
1. object's field name: ${object.field_name} or
2. many2one field name: ${object.many2one_field_id.field_name}
This section (on the left) allows you to add dynamic fields inside the description and special terms.
<ol>
<li>Select the agreement 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 description or the special terms</li>
</ol>
</p>
</div>
</group>
<group name="parties" string="Parties">
<group name="partner"
string="Partner">

View File

@@ -42,13 +42,32 @@
</group>
</group>
<field name="content" widget="html"/>
<div class="oe_edit_only">
<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>
For dynamic content use mako expression '${expression}'. For ex:
1. object's field name: ${object.field_name} or
2. many2one field name: ${object.many2one_field_id.field_name}
This section (on the left) allows you to add dynamic fields inside the content.
<ol>
<li>Select the appendix 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>
</div>
</group>
</sheet>
</form>
</field>

View File

@@ -44,13 +44,32 @@
</group>
</group>
<field name="content" widget="html"/>
<div class="oe_edit_only">
<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>
For dynamic content use mako expression '${expression}'. For ex:
1. object's field name: ${object.field_name} or
2. many2one field name: ${object.many2one_field_id.field_name}
This section (on the left) allows you to add dynamic fields inside the content.
<ol>
<li>Select the clause 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>
</div>
</group>
</sheet>
</form>
</field>

View File

@@ -42,13 +42,32 @@
</group>
</group>
<field name="content" widget="html"/>
<div class="oe_edit_only">
<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>
For dynamic content use mako expression '${expression}'. For ex:
1. object's field name: ${object.field_name} or
2. many2one field name: ${object.many2one_field_id.field_name}
This section (on the left) allows you to add dynamic fields inside the content.
<ol>
<li>Select the recital 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>
</div>
</group>
</sheet>
</form>
</field>

View File

@@ -44,13 +44,32 @@
<notebook>
<page string="Content">
<field name='content' nolabel="1"/>
<div class="oe_edit_only">
<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>
For dynamic content use mako expression '${expression}'. For ex:
1. object's field name: ${object.field_name} or
2. many2one field name: ${object.many2one_field_id.field_name}
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>
</div>
</group>
</page>
<page string="Clauses">
<field name="clauses_ids"

View File

@@ -25,7 +25,11 @@
<h1><field name="name"/></h1>
</div>
<field name="agreement_subtypes_ids"
nolabel="1"/>
nolabel="1">
<tree editable="bottom">
<field name="name"/>
</tree>
</field>
</sheet>
</form>
</field>