<?xml version="1.0"?>
<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
    <data>

        <record model="ir.ui.view" id="inventory_view_form">
            <field name="model">stock.inventory</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <![CDATA[
                    <form string="Inventory" col="4">
                        <label name="location"/>
                        <field name="location"/>
                        <label name="lost_found"/>
                        <field name="lost_found"/>
                        <label name="date"/>
                        <field name="date"/>
                        <label name="company"/>
                        <field name="company"/>
                        <label colspan="2" id="empty"/>
                        <button string="Complete Inventory"
                            name="complete_lines" type="object" colspan="2"
                            help="Add an inventory line for each missing products"/>
                        <field name="lines" colspan="4"/>
                        <group col="4" colspan="4" id="group_buttons">
                            <label name="state"/>
                            <field name="state"/>
                            <group colspan="2" col="3" id="buttons">
                                <button string="Cancel" name="cancel"
                                    type="object" icon="tryton-cancel" />
                                <button string="Confirm" name="confirm"
                                    type="object" icon="tryton-ok"/>
                            </group>
                        </group>
                    </form>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="inventory_view_tree">
            <field name="model">stock.inventory</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <![CDATA[
                    <tree string="Inventories">
                        <field name="location"/>
                        <field name="date"/>
                        <field name="state"/>
                        <field name="company"/>
                        <field name="create_date" tree_invisible="1"/>
                    </tree>
                ]]>
            </field>
        </record>
        <record model="ir.action.act_window" id="act_inventory_form">
            <field name="name">Inventories</field>
            <field name="res_model">stock.inventory</field>
            <field name="search_value">[('create_date', '>=', DateTime(hour=0, minute=0, second=0, microsecond=0, delta_years=-1))]</field>
        </record>
        <record model="ir.action.act_window.view"
                id="act_inventory_form_view1">
            <field name="sequence" eval="1"/>
            <field name="view" ref="inventory_view_tree"/>
            <field name="act_window" ref="act_inventory_form"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_inventory_form_view2">
            <field name="sequence" eval="2"/>
            <field name="view" ref="inventory_view_form"/>
            <field name="act_window" ref="act_inventory_form"/>
        </record>
        <menuitem parent="menu_stock" sequence="50"
            action="act_inventory_form" id="menu_inventory_form"/>

        <record model="ir.action.act_window" id="act_inventory_form_draft">
            <field name="name">Draft Inventories</field>
            <field name="res_model">stock.inventory</field>
            <field name="domain">[('state', '=', 'draft')]</field>
        </record>
        <record model="ir.action.act_window.view"
                id="act_inventory_form_draft_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="inventory_view_tree"/>
            <field name="act_window" ref="act_inventory_form_draft"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_inventory_form_draft_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="inventory_view_form"/>
            <field name="act_window" ref="act_inventory_form_draft"/>
        </record>
        <menuitem parent="menu_inventory_form"
            action="act_inventory_form_draft" id="menu_inventory_form_draft"
            sequence="20"/>

        <record model="ir.ui.view" id="inventory_line_view_form">
            <field name="model">stock.inventory.line</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <![CDATA[
                    <form string="Inventory Line" col="4">
                        <label name="product"/>
                        <field name="product"/>
                        <label name="uom"/>
                        <field name="uom"/>
                        <label name="expected_quantity"/>
                        <field name="expected_quantity"/>
                        <label name="quantity"/>
                        <field name="quantity"/>
                        <label name="move"/>
                        <field name="move"/>
                        <label name="inventory"/>
                        <field name="inventory"/>
                        <field name="unit_digits" invisible="1" colspan="4"/>
                    </form>
                ]]>
            </field>
        </record>
        <record model="ir.ui.view" id="inventory_line_view_tree">
            <field name="model">stock.inventory.line</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <![CDATA[
                    <tree string="Inventory Lines" editable="bottom">
                        <field name="product"/>
                        <field name="expected_quantity"/>
                        <field name="quantity"/>
                        <field name="uom"/>
                        <field name="unit_digits" tree_invisible="1"/>
                    </tree>
                ]]>
            </field>
        </record>

        <record model="ir.model.access" id="access_inventory">
            <field name="model" search="[('model', '=', 'stock.inventory')]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_inventory_group_stock">
            <field name="model" search="[('model', '=', 'stock.inventory')]"/>
            <field name="group" ref="group_stock"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

        <record model="ir.model.access" id="access_inventory_line">
            <field name="model" search="[('model', '=', 'stock.inventory.line')]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_inventory_line_group_stock">
            <field name="model" search="[('model', '=', 'stock.inventory.line')]"/>
            <field name="group" ref="group_stock"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

        <record model="ir.model.button" id="inventory_confirm_button">
            <field name="name">confirm</field>
            <field name="model" search="[('model', '=', 'stock.inventory')]"/>
        </record>
        <record model="ir.model.button-res.group"
            id="inventory_confirm_button_group_stock">
            <field name="button" ref="inventory_confirm_button"/>
            <field name="group" ref="group_stock"/>
        </record>

        <record model="ir.model.button" id="inventory_cancel_button">
            <field name="name">cancel</field>
            <field name="model" search="[('model', '=', 'stock.inventory')]"/>
        </record>
        <record model="ir.model.button-res.group"
            id="inventory_cancel_button_group_stock">
            <field name="button" ref="inventory_cancel_button"/>
            <field name="group" ref="group_stock"/>
        </record>

    </data>
</tryton>
