<?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="name">inventory_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="name">inventory_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"
                eval="[('create_date', '>=', DateTime(hour=0, minute=0, second=0, microsecond=0, delta_years=-1))]"
                pyson="1"/>
        </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>
        <record model="ir.action.act_window.domain" id="act_inventory_form_domain_draft">
            <field name="name">Draft</field>
            <field name="sequence" eval="10"/>
            <field name="domain" eval="[('state', '=', 'draft')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_inventory_form"/>
        </record>
        <record model="ir.action.act_window.domain" id="act_inventory_form_domain_all">
            <field name="name">All</field>
            <field name="sequence" eval="9999"/>
            <field name="domain"></field>
            <field name="act_window" ref="act_inventory_form"/>
        </record>
        <menuitem
            parent="menu_stock"
            action="act_inventory_form"
            sequence="20"
            id="menu_inventory_form"/>

        <record model="ir.ui.view" id="inventory_line_view_form">
            <field name="model">stock.inventory.line</field>
            <field name="type">form</field>
            <field name="name">inventory_line_form</field>
        </record>

        <record model="ir.ui.view" id="inventory_line_view_list">
            <field name="model">stock.inventory.line</field>
            <field name="type">tree</field>
            <field name="name">inventory_line_list</field>
        </record>

        <record model="ir.action.act_window" id="act_inventory_line_relate">
            <field name="name">Inventory Lines</field>
            <field name="res_model">stock.inventory.line</field>
            <field
                name="domain"
                eval="[If(Eval('active_ids', []) == [Eval('active_id')], ('inventory', '=', Eval('active_id')), ('inventory', 'in', Eval('active_ids')))]"
                pyson="1"/>
        </record>
        <record model="ir.action.keyword" id="act_inventory_line_relate_keyword1">
            <field name="keyword">form_relate</field>
            <field name="model">stock.inventory,-1</field>
            <field name="action" ref="act_inventory_line_relate"/>
        </record>

        <record model="ir.rule.group" id="rule_group_inventory_companies">
            <field name="name">User in companies</field>
            <field name="model">stock.inventory</field>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_inventory_companies">
            <field name="domain"
                eval="[('company', 'in', Eval('companies', []))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_inventory_companies"/>
        </record>

        <record model="ir.model.access" id="access_inventory">
            <field name="model">stock.inventory</field>
            <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">stock.inventory</field>
            <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="model">stock.inventory</field>
            <field name="name">confirm</field>
            <field name="string">Confirm</field>
            <field name="confirm">Are you sure you want to confirm the inventory?</field>
        </record>

        <record model="ir.model.button" id="inventory_cancel_button">
            <field name="model">stock.inventory</field>
            <field name="name">cancel</field>
            <field name="string">Cancel</field>
            <field name="confirm">Are you sure you want to cancel the inventory?</field>
        </record>

        <record model="ir.model.button" id="inventory_complete_lines_button">
            <field name="model">stock.inventory</field>
            <field name="name">complete_lines</field>
            <field name="string">Complete</field>
            <field name="help">Add an inventory line for each missing products</field>
        </record>

        <record model="ir.model.button" id="inventory_count_button">
            <field name="model">stock.inventory</field>
            <field name="name">do_count</field>
            <field name="string">Count</field>
            <field name="help">Launch the wizard to count products</field>
        </record>

        <record model="ir.action.wizard" id="wizard_inventory_count">
            <field name="name">Count</field>
            <field name="wiz_name">stock.inventory.count</field>
            <field name="model">stock.inventory</field>
        </record>

        <record model="ir.ui.view" id="inventory_count_search_view_form">
            <field name="model">stock.inventory.count.search</field>
            <field name="type">form</field>
            <field name="name">inventory_count_search_form</field>
        </record>

        <record model="ir.ui.view" id="inventory_count_quantity_view_form">
            <field name="model">stock.inventory.count.quantity</field>
            <field name="type">form</field>
            <field name="name">inventory_count_quantity_form</field>
        </record>

        <record model="ir.sequence.type" id="sequence_type_inventory">
            <field name="name">Inventory</field>
        </record>
        <record model="ir.sequence.type-res.group"
            id="sequence_type_inventory_group_admin">
            <field name="sequence_type" ref="sequence_type_inventory"/>
            <field name="group" ref="res.group_admin"/>
        </record>
        <record model="ir.sequence.type-res.group"
            id="sequence_type_inventory_group_stock_admin">
            <field name="sequence_type" ref="sequence_type_inventory"/>
            <field name="group" ref="group_stock_admin"/>
        </record>

        <record model="ir.sequence" id="sequence_inventory">
            <field name="name">Inventory</field>
            <field name="sequence_type" ref="sequence_type_inventory"/>
        </record>

    </data>
</tryton>
