<?xml version="1.0"?>
<form string="Fields" duplicate="false">
                    <sheet>
                        <group>
                            <group>
                                <field name="name"/>
                                <field name="field_description"/>
                                <field name="model_id" readonly="state != 'manual'"/>
                            </group>
                            <group>
                                <field name="ttype"/>
                                <field name="help"/>
                            </group>
                        </group>
                        <notebook>
                            <page name="base" string="Properties">
                                <group string="Base Properties">
                                    <group>
                                        <field name="required"/>
                                        <field name="readonly"/>
                                        <field name="store" groups="base.group_no_one"/>
                                        <field name="index" groups="base.group_no_one"/>
                                        <field name="copied" groups="base.group_no_one"/>
                                    </group>
                                    <group>
                                        <field name="translate" invisible="ttype not in ['char', 'text', 'html']" readonly="ttype not in ['char', 'text', 'html']"/>
                                        <field name="size" groups="base.group_no_one" invisible="ttype not in ['char', 'reference']" readonly="ttype not in ['char', 'reference']"/>
                                        <field name="relation" invisible="ttype not in ['many2one', 'one2many', 'many2many']" readonly="ttype not in ['many2one', 'one2many', 'many2many']" required="ttype in ['many2one', 'one2many', 'many2many']"/>
                                        <field name="group_expand" groups="base.group_no_one" invisible="ttype not in ['many2one', 'selection']" readonly="ttype not in ['many2one', 'selection']"/>
                                        <field name="on_delete" groups="base.group_no_one" invisible="ttype != 'many2one'" readonly="ttype != 'many2one'"/>
                                        <field name="relation_field" invisible="ttype != 'one2many'" readonly="ttype != 'one2many'" required="ttype == 'one2many'"/>
                                        <field name="relation_table" groups="base.group_no_one" invisible="ttype != 'many2many' or state != 'manual'" readonly="ttype != 'many2many' or state != 'manual'"/>
                                        <field name="column1" groups="base.group_no_one" invisible="ttype != 'many2many' or state != 'manual'" readonly="ttype != 'many2many' or state != 'manual'"/>
                                        <field name="column2" groups="base.group_no_one" invisible="ttype != 'many2many' or state != 'manual'" readonly="ttype != 'many2many' or state != 'manual'"/>
                                        <field name="domain" groups="base.group_no_one" invisible="ttype not in ['many2one', 'one2many', 'many2many']" readonly="ttype not in ['many2one', 'one2many', 'many2many']"/>
                                        <field name="currency_field" invisible="ttype != 'monetary'" readonly="ttype != 'monetary'"/>
                                    </group>
                                </group>
                                <group string="HTML/Sanitization Properties">
                                    <group>
                                        <field name="sanitize" invisible="ttype != 'html'" readonly="ttype != 'html'"/>
                                        <field name="sanitize_overridable" invisible="ttype != 'html' or sanitize == False" readonly="ttype != 'html' or sanitize == False"/>
                                        <field name="sanitize_tags" invisible="ttype != 'html' or sanitize == False" readonly="ttype != 'html' or sanitize == False"/>
                                        <field name="sanitize_attributes" invisible="ttype != 'html' or sanitize == False" readonly="ttype != 'html' or sanitize == False"/>
                                    </group>
                                    <group>
                                        <field name="sanitize_style" invisible="ttype != 'html' or sanitize == False" readonly="ttype != 'html' or sanitize == False"/>
                                        <field name="sanitize_form" invisible="ttype != 'html' or sanitize == False" readonly="ttype != 'html' or sanitize == False"/>
                                        <field name="strip_style" invisible="ttype != 'html' or sanitize == False" readonly="ttype != 'html' or sanitize == False"/>
                                        <field name="strip_classes" invisible="ttype != 'html' or sanitize == False" readonly="ttype != 'html' or sanitize == False"/>
                                    </group>
                                </group>
                                <group invisible="ttype not in ['selection', 'reference']" readonly="ttype not in ['selection', 'reference']">
                                    <field name="selection_ids">
                                        <list editable="bottom">
                                            <field name="sequence" widget="handle"/>
                                            <field name="value"/>
                                            <field name="name"/>
                                        </list>
                                    </field>
                                </group>
                                <group string="Advanced Properties" groups="base.group_no_one">
                                    <field name="related"/>
                                    <field name="depends" required="compute not in [False, '']"/>
                                    <field name="compute" widget="code" options="{'mode': 'python'}"/>
                                </group>
                                <div groups="base.group_no_one">
                                    <h3>How to define a computed field</h3>
                                    <p>Computed fields are defined with the fields
                                    <strong>Dependencies</strong> and <strong>Compute</strong>.</p>
                                    <p>The field <strong>Dependencies</strong> lists the fields that
                                    the current field depends on. It is a comma-separated list of
                                    field names, like <code>name, size</code>. You can also refer to
                                    fields accessible through other relational fields, for instance
                                    <code>partner_id.company_id.name</code>.</p>
                                    <p>The field <strong>Compute</strong> 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.</p>
                                    <pre>
    for record in self:
        record['size'] = len(record.name)
</pre>
                                    <p>The only predefined variables are</p>
                                    <ul>
                                        <li><code>self</code> (the set of records to compute)</li>
                                        <li><code>datetime</code> (Python module)</li>
                                        <li><code>dateutil</code> (Python module)</li>
                                        <li><code>time</code> (Python module)</li>
                                    </ul>
                                    <p>Other features are accessible through <code>self</code>, like
                                    <code>self.env</code>, etc.</p>
                                </div>
                            </page>
                            <page name="groups" string="Access Rights">
                                <field name="groups"/>
                            </page>
                            <page name="misc" string="Miscellaneous" groups="base.group_no_one">
                                <group>
                                    <field name="state"/>
                                    <field name="modules"/>
                                </group>
                            </page>
                        </notebook>
                    </sheet>
                </form>
            