<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_changeset_field_rule_tree" model="ir.ui.view">
        <field name="model">changeset.field.rule</field>
        <field name="arch" type="xml">
            <tree>
                <field name="model_id" />
                <field name="field_id" options="{'no_create': True}" />
                <field name="source_model_id" />
                <field name="expression" />
                <field name="validator_group_ids" />
                <field
                    name="company_id"
                    groups="base.group_multi_company"
                    options="{'no_create': True}"
                />
                <field name="action" />
            </tree>
        </field>
    </record>
    <record id="view_changeset_field_rule_form" model="ir.ui.view">
        <field name="model">changeset.field.rule</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group>
                        <group>
                            <field name="model_id" options="{'no_open': True}" />
                            <field
                                name="field_id"
                                options="{'no_create_edit': True, 'no_open': True}"
                                domain="[('ttype', 'in', ('char', 'selection', 'date', 'datetime', 'float', 'monetary', 'integer', 'text', 'boolean', 'many2one')),
                                            ('readonly', '=', False)]"
                            />
                        </group>
                        <group>
                            <field
                                name="company_id"
                                groups="base.group_multi_company"
                                options="{'no_create': True}"
                            />
                            <field name="action" />
                            <field name="source_model_id" widget="selection" />
                            <field name="prevent_self_validation" />
                            <field name="expression" placeholder="True" />
                            <field name="validator_group_ids" widget="many2many_tags" />
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="view_changeset_field_rule_search" model="ir.ui.view">
        <field name="model">changeset.field.rule</field>
        <field name="arch" type="xml">
            <search>
                <field name="field_id" />
                <field name="source_model_id" />
                <field name="action" />
                <field name="validator_group_ids" />
                <group string="Group By" name="groupby">
                    <filter
                        name="model_groupby"
                        string="Model"
                        context="{'group_by': 'model_id'}"
                    />
                </group>
            </search>
        </field>
    </record>
    <record id="action_changeset_field_rule_view" model="ir.actions.act_window">
        <field name="name">Changeset Fields Rules</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">changeset.field.rule</field>
        <field name="view_mode">tree,form</field>
        <field name="context" eval="{'search_default_model_groupby': 1}" />
        <field name="search_view_id" ref="view_changeset_field_rule_search" />
    </record>
</odoo>
