<?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="lot_view_form">
            <field name="model">stock.lot</field>
            <field name="type">form</field>
            <field name="name">lot_form</field>
        </record>

        <record model="ir.ui.view" id="lot_view_tree">
            <field name="model">stock.lot</field>
            <field name="type">tree</field>
            <field name="name">lot_tree</field>
        </record>

        <record model="ir.ui.view" id="lot_view_list_stock_move">
            <field name="model">stock.lot</field>
            <field name="type">tree</field>
            <field name="priority" eval="20"/>
            <field name="name">lot_list_stock_move</field>
        </record>

        <record model="ir.action.act_window" id="act_lot_form">
            <field name="name">Lots</field>
            <field name="res_model">stock.lot</field>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="lot_view_tree"/>
            <field name="act_window" ref="act_lot_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="lot_view_form"/>
            <field name="act_window" ref="act_lot_form"/>
        </record>
        <menuitem
            parent="stock.menu_stock"
            action="act_lot_form"
            sequence="50"
            id="menu_lot_form"/>

        <record model="ir.action.act_window" id="act_lot_form_product_relate">
            <field name="name">Lots</field>
            <field name="res_model">stock.lot</field>
            <field
                name="domain"
                eval="[If(Eval('active_ids', []) == [Eval('active_id')], (If(Eval('active_model') == 'product.template', 'product.template', 'product'), '=', Eval('active_id', -1)), (If(Eval('active_model') == 'product.template', 'product.template', 'product'), 'in', Eval('active_ids', [])))]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_form_product_relate_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="lot_view_tree"/>
            <field name="act_window" ref="act_lot_form_product_relate"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_form_product_relate_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="lot_view_form"/>
            <field name="act_window" ref="act_lot_form_product_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_lot_form_product_relate_keyword1">
            <field name="keyword">form_relate</field>
            <field name="model">product.product,-1</field>
            <field name="action" ref="act_lot_form_product_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_lot_form_product_relate_keyword2">
            <field name="keyword">form_relate</field>
            <field name="model">product.template,-1</field>
            <field name="action" ref="act_lot_form_product_relate"/>
        </record>

        <record model="ir.model.access" id="access_lot">
            <field name="model">stock.lot</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_lot_group_stock">
            <field name="model">stock.lot</field>
            <field name="group" ref="stock.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="lot_upward_traces_button">
            <field name="model">stock.lot</field>
            <field name="name">upward_traces</field>
            <field name="string">Upward Traces</field>
        </record>

        <record model="ir.model.button" id="lot_downward_traces_button">
            <field name="model">stock.lot</field>
            <field name="name">downward_traces</field>
            <field name="string">Downward Traces</field>
        </record>

        <record model="ir.ui.view" id="lot_trace_view_tree_upward">
            <field name="model">stock.lot.trace</field>
            <field name="type">tree</field>
            <field name="field_childs">upward_traces</field>
            <field name="name">lot_trace_tree</field>
        </record>

        <record model="ir.ui.view" id="lot_trace_view_tree_downward">
            <field name="model">stock.lot.trace</field>
            <field name="type">tree</field>
            <field name="field_childs">downward_traces</field>
            <field name="name">lot_trace_tree</field>
        </record>

        <record model="ir.action.act_window" id="act_lot_trace_upward_relate">
            <field name="name">Upward Traces</field>
            <field name="res_model">stock.lot.trace</field>
            <field
                name="domain"
                eval="[('lot', 'in', Eval('active_ids', []))]"
                pyson="1"/>
            <field
                name="order"
                eval="[('date', 'ASC'), ('id', 'ASC')]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_trace_upward_relate_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="lot_trace_view_tree_upward"/>
            <field name="act_window" ref="act_lot_trace_upward_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_lot_trace_upward_relate_keyword1">
            <field name="keyword">form_relate</field>
            <field name="model">stock.lot,-1</field>
            <field name="action" ref="act_lot_trace_upward_relate"/>
        </record>

        <record model="ir.action.act_window" id="act_lot_trace_downward_relate">
            <field name="name">Downward Traces</field>
            <field name="res_model">stock.lot.trace</field>
            <field
                name="domain"
                eval="[('lot', 'in', Eval('active_ids', []))]"
                pyson="1"/>
            <field
                name="order"
                eval="[('date', 'DESC'), ('id', 'DESC')]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_trace_downward_relate_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="lot_trace_view_tree_downward"/>
            <field name="act_window" ref="act_lot_trace_downward_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_lot_trace_downward_relate_keyword1">
            <field name="keyword">form_relate</field>
            <field name="model">stock.lot,-1</field>
            <field name="action" ref="act_lot_trace_downward_relate"/>
        </record>

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

        <record model="ir.model.access" id="access_lot_trace">
            <field name="model">stock.lot.trace</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_lot_trace_group_stock">
            <field name="model">stock.lot.trace</field>
            <field name="group" ref="stock.group_stock"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <record model="ir.ui.view" id="lots_by_location_context_view_form">
            <field name="model">stock.lots_by_location.context</field>
            <field name="type">form</field>
            <field name="name">lot_by_location_context_form</field>
        </record>

        <record model="ir.ui.view" id="lots_by_locations_view_list">
            <field name="model">stock.lots_by_locations</field>
            <field name="type">tree</field>
            <field name="name">lots_by_locations_list</field>
        </record>

        <record model="ir.model.access" id="access_lots_by_locations">
            <field name="model">stock.lots_by_locations</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_lots_by_locations_group_stock">
            <field name="model">stock.lots_by_locations</field>
            <field name="group" ref="stock.group_stock"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>

        <record model="ir.action.act_window" id="act_lots_by_locations_relate">
            <field name="name">Lots</field>
            <field name="res_model">stock.lots_by_locations</field>
            <field name="context" eval="{'locations': Eval('active_ids')}" pyson="1"/>
            <field name="domain"
                eval="['OR', ('quantity', '!=', 0.0), ('forecast_quantity', '!=', 0.0)]"
                pyson="1"/>
            <field name="context_model">stock.lots_by_location.context</field>
        </record>
        <record model="ir.action.act_window.view" id="act_lots_by_locations_relate_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="lots_by_locations_view_list"/>
            <field name="act_window" ref="act_lots_by_locations_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_lots_by_locations_relate_keyword1">
            <field name="keyword">tree_open</field>
            <field name="model">stock.location,-1</field>
            <field name="action" ref="act_lots_by_locations_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_lots_by_locations_relate_keyword2">
            <field name="keyword">form_relate</field>
            <field name="model">stock.location,-1</field>
            <field name="action" ref="act_lots_by_locations_relate"/>
        </record>

        <record model="ir.action.act_window" id="act_location_quantity_tree">
            <field name="name">Stock Locations Tree</field>
            <field name="res_model">stock.location</field>
            <field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
            <field
                name="context"
                eval="{'lot': Eval('active_id'), 'stock_skip_warehouse': False}"
                pyson="1"/>
            <field name="context_model">stock.lots_by_location.context</field>
        </record>
        <record model="ir.action.act_window.view" id="act_location_quantity_tree_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="stock.location_quantity_view_tree"/>
            <field name="act_window" ref="act_location_quantity_tree"/>
        </record>
        <record model="ir.action.keyword" id="act_location_quantity_tree_keyword1">
            <field name="keyword">form_relate</field>
            <field name="model">stock.lot,-1</field>
            <field name="action" ref="act_location_quantity_tree"/>
        </record>

        <record model="ir.action.act_window" id="act_location_quantity_list">
            <field name="name">Stock Locations List</field>
            <field name="res_model">stock.location</field>
            <field name="search_value" eval="['OR', ('quantity', '!=', 0), ('forecast_quantity', '!=', 0)]" pyson="1"/>
            <field
                name="context"
                eval="{'lot': Eval('active_id'), 'with_childs': False, 'stock_skip_warehouse': False}"
                pyson="1"/>
            <field name="context_model">stock.lots_by_location.context</field>
        </record>
        <record model="ir.action.act_window.view" id="act_location_quantity_list_view">
            <field name="sequence" eval="10"/>
            <field name="view" ref="stock.location_quantity_view_list"/>
            <field name="act_window" ref="act_location_quantity_list"/>
        </record>
        <record model="ir.action.keyword" id="act_location_quantity_list_keyword1">
            <field name="keyword">form_relate</field>
            <field name="model">stock.lot,-1</field>
            <field name="action" ref="act_location_quantity_list"/>
        </record>

        <record model="ir.ui.view" id="move_view_form">
            <field name="model">stock.move</field>
            <field name="inherit" ref="stock.move_view_form"/>
            <field name="name">move_form</field>
        </record>

        <record model="ir.ui.view" id="move_view_tree">
            <field name="model">stock.move</field>
            <field name="inherit" ref="stock.move_view_tree"/>
            <field name="name">move_tree</field>
        </record>

        <record model="ir.ui.view" id="move_view_list_shipment_in">
            <field name="model">stock.move</field>
            <field name="inherit" ref="stock.move_view_list_shipment_in"/>
            <field name="name">move_tree</field>
        </record>

        <record model="ir.ui.view" id="move_view_list_shipment">
            <field name="model">stock.move</field>
            <field name="inherit" ref="stock.move_view_list_shipment"/>
            <field name="name">move_tree</field>
        </record>

        <record model="ir.model.button" id="move_add_lots_wizard_button">
            <field name="model">stock.move</field>
            <field name="name">add_lots_wizard</field>
            <field name="string">Add Lots</field>
        </record>

        <record model="ir.action.wizard" id="wizard_move_add_lots">
            <field name="name">Add Lots</field>
            <field name="wiz_name">stock.move.add.lots</field>
            <field name="model">stock.move</field>
        </record>

        <record model="ir.ui.view" id="move_add_lots_start_view_form">
            <field name="model">stock.move.add.lots.start</field>
            <field name="type">form</field>
            <field name="name">stock_move_add_lots_start_form</field>
        </record>

        <record model="ir.ui.view" id="move_add_lots_start_lot_view_list">
            <field name="model">stock.move.add.lots.start.lot</field>
            <field name="type">tree</field>
            <field name="name">stock_move_add_lots_start_lot_list</field>
        </record>

        <record model="ir.model.button" id="move_add_lots_start_duplicate_lot_button">
            <field name="model">stock.move.add.lots.start</field>
            <field name="name">duplicate_lot</field>
            <field name="string">Duplicate Lot</field>
        </record>

        <record model="ir.ui.view" id="period_cache_lot_view_form">
            <field name="model">stock.period.cache.lot</field>
            <field name="type">form</field>
            <field name="name">period_cache_lot_form</field>
        </record>
        <record model="ir.ui.view" id="period_cache_lot_view_list">
            <field name="model">stock.period.cache.lot</field>
            <field name="type">tree</field>
            <field name="name">period_cache_lot_list</field>
        </record>

        <record model="ir.model.access" id="access_period_cache_lot">
            <field name="model">stock.period.cache.lot</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_period_cache_lot_stock">
            <field name="model">stock.period.cache.lot</field>
            <field name="group" ref="stock.group_stock"/>
            <field name="perm_read" eval="True"/>
            <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_period_cache_lot_admin">
            <field name="model">stock.period.cache.lot</field>
            <field name="group" ref="stock.group_stock_admin"/>
            <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.ui.view" id="inventory_line_view_form">
            <field name="model">stock.inventory.line</field>
            <field name="inherit" ref="stock.inventory_line_view_form"/>
            <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="inherit" ref="stock.inventory_line_view_list"/>
            <field name="name">inventory_line_list</field>
        </record>

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

    </data>
</tryton>
