flectra/addons/digest/wizard/digest_custom_fields_view.xml

64 lines
3.1 KiB
XML
Raw Normal View History

2018-08-20 11:29:49 +02:00
<?xml version="1.0"?>
<flectra>
<record id="digest_custom_fields_view_form" model="ir.ui.view">
<field name="name">digest.custom.fields.form</field>
<field name="model">digest.custom.fields</field>
<field name="arch" type="xml">
<form string="Customized Digest">
<group col="4">
2018-08-20 11:29:49 +02:00
<field name="field_name"/>
<field name="label_name"/>
<field name="available_group_name" required="1"/>
<field name="position" required="1"/>
<field name="new_group_name" attrs="{'required': [('position', '!=', 'inside')], 'invisible': [('position', 'not in', ['before', 'after'])]}"/>
2018-08-20 11:29:49 +02:00
</group>
<group>
<label for="model_id"/>
<div>
<field name="model_id" options="{'no_create': True}" required="1"/>
<field name="model_name" invisible="1"/>
<field name="model_real" invisible="1"/>
<field name="model_domain" widget="domain"
options="{'model': 'model_real'}"/>
</div>
2018-08-20 11:29:49 +02:00
</group>
<group>
<field name="related_date_field_id" options="{'no_create': True}" domain="[('model', '=', model_real), ('ttype', 'in', ['date', 'datetime'])]" required="1"/>
</group>
<notebook>
<page string="Compute Details">
<group>
<field name="compute_field_name"/>
<field name="ttype"/>
<field name="compute" widget="ace" options="{'mode': 'python'}"/>
</group>
</page>
<page string="Help">
<h3>How to define a computed field</h3>
<div class="alert alert-info" role="alert">
The field <code>Compute</code> is the Python code to compute the value of the field on a set of records.
The value of the field must be assigned to each record with a dictionary-like assignment.
<pre>
for record in self:
record['size'] = len(record.name)</pre>
</div>
</page>
</notebook>
2018-08-20 11:29:49 +02:00
<footer>
<button name="action_add_customize_digest" string="Save" type="object" class="btn btn-sm btn-primary"/>
2018-08-20 11:29:49 +02:00
<button string="Cancel" class="btn btn-sm btn-default" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="digest_custom_fields_action" model="ir.actions.act_window">
<field name="name">Customized Digest</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">digest.custom.fields</field>
<field name="view_mode">form</field>
<field name="view_id" ref="digest_custom_fields_view_form"/>
<field name="target">new</field>
</record>
</flectra>