<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
     Copyright 2016 Tecnativa - Vicent Cubells
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>
    <record id="match_form_view" model="ir.ui.view">
        <field name="name">Import match form view</field>
        <field name="model">base_import.match</field>
        <field name="arch" type="xml">
            <form string="Import Match">
                <sheet>
                    <h1>
                        <field name="name" />
                    </h1>
                    <group>
                        <field name="model_id" />
                        <field name="field_ids">
                            <tree editable="bottom">
                                <field name="field_id" options="{'no_create': True}" />
                                <field
                                    name="match_id"
                                    invisible="True"
                                    required="False"
                                />
                                <field name="model_id" invisible="True" />
                                <field name="conditional" />
                                <field
                                    name="imported_value"
                                    attrs="{
                                    'readonly': [
                                        ('conditional', '=', False),
                                    ],
                                }"
                                />
                            </tree>
                        </field>
                        <field name="sequence" />
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="match_tree_view" model="ir.ui.view">
        <field name="name">Import match tree view</field>
        <field name="model">base_import.match</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="sequence" invisible="True" />
            </tree>
        </field>
    </record>
    <record id="match_search_view" model="ir.ui.view">
        <field name="name">Import match search view</field>
        <field name="model">base_import.match</field>
        <field name="arch" type="xml">
            <search string="Import Match">
                <field name="name" />
                <field name="model_id" />
                <field name="field_ids" />
                <separator />
                <group expand="0" string="Group By">
                    <filter
                        string="Model"
                        context="{'group_by': 'model_id'}"
                        name="model"
                    />
                </group>
            </search>
        </field>
    </record>

    <record id="match_action" model="ir.actions.act_window">
        <field name="type">ir.actions.act_window</field>
        <field name="name">Import Match</field>
        <field name="res_model">base_import.match</field>
        <field name="view_mode">tree,form</field>
    </record>

    <menuitem id="match_menu" action="match_action" parent="base.next_id_9" />
</odoo>
