<?xml version="1.0" encoding="UTF-8"?>
<!-- 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_fcr_view_tree">
            <field name="model">lot.fcr</field>
            <field name="type">tree</field>
            <field name="name">lot_fcr_tree</field>
        </record>
        <record model="ir.ui.view" id="lot_fcr_view_tree_sequence">
            <field name="model">lot.fcr</field>
            <field name="type">tree</field>
            <field name="name">lot_fcr_tree_sequence</field>
        </record>

        <record model="ir.ui.view" id="lot_report_view_list">
            <field name="model">lot.report</field>
            <field name="type">tree</field>
            <field name="name">lot_report_list</field>
        </record>
        <record model="ir.ui.view" id="lot_report_view_graph">
            <field name="model">lot.report</field>
            <field name="type">graph</field>
            <field name="name">lot_report_graph</field>
        </record>

        <record model="ir.ui.view" id="view_lot_visgraph">
            <field name="model">lot.lot</field>
            <field name="type">graph</field>
            <field name="name">lot_graph</field>
            <field name="priority" eval="10"/>
        </record>
        <record model="ir.action.act_window" id="act_lot_visgraph">
            <field name="name">Lots graph</field>
            <field name="res_model">lot.lot</field>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_visgraph_form_view">
            <field name="sequence" eval="80"/>
            <field name="view" ref="view_lot_visgraph"/>
            <field name="act_window" ref="act_lot_visgraph"/>
        </record>

        <record model="ir.ui.view" id="view_lot_report_visgraph">
            <field name="model">lot.report</field>
            <field name="type">graph</field>
            <field name="name">lot_graph</field>
        </record>

        <record model="ir.ui.view" id="lot_acc_graph_view_form">
            <field name="model">lot.accounting</field>
            <field name="type">form</field>
            <field name="name">lot_acc_form</field>
        </record>
        <record model="ir.ui.view" id="lot_acc_graph_view_tree">
            <field name="model">lot.accounting</field>
            <field name="type">tree</field>
            <field name="name">lot_acc_tree</field>
        </record>
        <record model="ir.action.act_window" id="act_lot_acc_form">
            <field name="name">Accounting graph</field>
            <field name="res_model">lot.accounting</field>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_acc_form_view">
            <field name="sequence" eval="80"/>
            <field name="view" ref="lot_acc_graph_view_form"/>
            <field name="act_window" ref="act_lot_acc_form"/>
        </record>

        <record model="ir.action.act_window" id="act_lot_fcr_form">
            <field name="name">FCR</field>
            <field name="res_model">lot.fcr</field>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_fcr_form_view">
            <field name="sequence" eval="80"/>
            <field name="view" ref="lot_fcr_view_tree"/>
            <field name="act_window" ref="act_lot_fcr_form"/>
        </record>

        <record model="ir.action.act_window" id="act_lot_report_form">
            <field name="name">Lots management</field>
            <field name="res_model">lot.report</field>
            <field name="context_model">lot.context</field>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_report_form_view">
            <field name="sequence" eval="70"/>
            <field name="view" ref="lot_report_view_list"/>
            <field name="act_window" ref="act_lot_report_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_report_form_graph2">
            <field name="sequence" eval="75"/>
            <field name="view" ref="view_lot_report_visgraph"/>
            <field name="act_window" ref="act_lot_report_form"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_report_form_graph">
            <field name="sequence" eval="80"/>
            <field name="view" ref="lot_report_view_graph"/>
            <field name="act_window" ref="act_lot_report_form"/>
        </record>
        <record model="ir.ui.view" id="lot_report_context_view_form">
            <field name="model">lot.context</field>
            <field name="type">form</field>
            <field name="name">lot_report_context_form</field>
        </record>

        <record model="ir.ui.view" id="shipping_view_form">
            <field name="model">lot.shipping.start</field>
            <field name="type">form</field>
            <field name="name">lot_shipping_start_form</field>
        </record>
        <record model="ir.action.wizard" id="act_shipping">
            <field name="name">🚢 Link lots to transport</field>
            <field name="wiz_name">lot.shipping</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_shipping_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_shipping"/>
        </record>

        <record model="ir.ui.view" id="add_lot_view_form">
            <field name="model">lot.add.lot</field>
            <field name="type">form</field>
            <field name="name">lot_add_start_form</field>
        </record>
        <record model="ir.ui.view" id="lot_view_tree_sequence5">
            <field name="model">lot.add.line</field>
            <field name="type">tree</field>
            <field name="name">lot_tree_sequence5</field>
        </record>
        <record model="ir.ui.view" id="import_lot_view_form">
            <field name="model">lot.import.lot</field>
            <field name="type">form</field>
            <field name="name">lot_import_start_form</field>
        </record>
        <record model="ir.ui.view" id="invoice_lot_view_form">
            <field name="model">lot.invoice.start</field>
            <field name="type">form</field>
            <field name="name">lot_invoice_start_form</field>
        </record>
        <record model="ir.ui.view" id="invoicing_lot_view_tree">
            <field name="model">lot.invoicing.lot</field>
            <field name="type">tree</field>
            <field name="name">lot_invoicing_lot_tree</field>
        </record>
        <record model="ir.ui.view" id="invoicing_fee_view_tree">
            <field name="model">lot.invoicing.fee</field>
            <field name="type">tree</field>
            <field name="name">lot_invoicing_fee_tree</field>
        </record>
        <record model="ir.ui.view" id="invoicing_inv_view_tree">
            <field name="model">lot.invoicing.inv</field>
            <field name="type">tree</field>
            <field name="name">lot_invoicing_inv_tree</field>
        </record>
        <record model="ir.ui.view" id="matching_view_form">
            <field name="model">lot.matching.start</field>
            <field name="type">form</field>
            <field name="name">lot_matching_start_form</field>
        </record>
        <record model="ir.ui.view" id="matching_lot_view_tree">
            <field name="model">lot.matching.lot</field>
            <field name="type">tree</field>
            <field name="name">lot_matching_lot_tree</field>
        </record>
        <record model="ir.ui.view" id="matching_lot_view_tree2">
            <field name="model">lot.matching.lot</field>
            <field name="type">tree</field>
            <field name="name">lot_matching_lot_tree2</field>
        </record>
        <record model="ir.action.wizard" id="act_matching">
            <field name="name">🔗 Apply matching</field>
            <field name="wiz_name">lot.matching</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_matching_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_matching"/>
        </record>
        <record model="ir.ui.view" id="weighing_view_form">
            <field name="model">lot.weighing.start</field>
            <field name="type">form</field>
            <field name="name">lot_weighing_start_form</field>
        </record>
        <record model="ir.ui.view" id="weighing_lot_view_tree">
            <field name="model">lot.weighing.lot</field>
            <field name="type">tree</field>
            <field name="name">lot_weighing_lot_tree</field>
        </record>
        <record model="ir.action.wizard" id="act_weighing">
            <field name="name">📦 Do weighing</field>
            <field name="wiz_name">lot.weighing</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_weighing_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_weighing"/>
        </record>

        <record model="ir.ui.view" id="contracts_view_form">
            <field name="model">contracts.start</field>
            <field name="type">form</field>
            <field name="name">contracts_start_form</field>
        </record>
        <record model="ir.ui.view" id="contract_detail_view_tree">
            <field name="model">contract.detail</field>
            <field name="type">tree</field>
            <field name="name">contract_detail_tree</field>
        </record>
        <record model="ir.action.wizard" id="act_create_contracts">
            <field name="name">📝 Create contracts</field>
            <field name="wiz_name">create.contracts</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_create_contract_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_create_contracts"/>
        </record>

        <!-- <record model="ir.action.wizard" id="matching_unit">
            <field name="name">Matching unit</field>
            <field name="wiz_name">lot.matching_unit</field>
            <field name="model">sale.line</field>
        </record> -->

        <record model="ir.action.wizard" id="act_adding">
            <field name="name">📦 Add physical lots</field>
            <field name="wiz_name">lot.add</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_adding_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_adding"/>
        </record>
        <record model="ir.action.wizard" id="act_importing">
            <field name="name">📦 Import physical lots</field>
            <field name="wiz_name">lot.import</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_importing_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_importing"/>
        </record>
        <record model="ir.action.wizard" id="act_removing">
            <field name="name">📦 Remove physical lots</field>
            <field name="wiz_name">lot.remove</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_removing_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_removing"/>
        </record>
        <record model="ir.action.wizard" id="act_invoicing">
            <field name="name">🧾 Invoice physical lots</field>
            <field name="wiz_name">lot.invoice</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_invoicing_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_invoicing"/>
        </record>

        <record model="ir.action.act_window" id="act_move_line_relate">
            <field name="name">Account move's lines</field>
            <field name="res_model">account.move.line</field>
            <field
                name="domain"
                eval="[
                If(Eval('active_model') == 'lot.report',
                ('lot', 'in', Eval('active_ids', [])), ()),
                ]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_move_line_relate_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="account.move_line_view_tree"/>
            <field name="act_window" ref="act_move_line_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_move_line_relate_keyword_lot_report">
            <field name="keyword">form_relate</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_move_line_relate"/>
        </record>

        <record model="ir.action.act_window" id="act_lot_acc_relate">
            <field name="name">Accounting graph</field>
            <field name="res_model">lot.accounting</field>
            <field
                name="domain"
                eval="[
                If(Eval('active_model') == 'lot.report',
                ('lot', 'in', Eval('active_ids', [])), ()),
                ]"
                pyson="1"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_acc_relate_tree">
            <field name="sequence" eval="10"/>
            <field name="view" ref="lot_acc_graph_view_tree"/>
            <field name="act_window" ref="act_lot_acc_relate"/>
        </record>
        <record model="ir.action.act_window.view" id="act_lot_acc_relate_view1">
            <field name="sequence" eval="20"/>
            <field name="view" ref="lot_acc_graph_view_form"/>
            <field name="act_window" ref="act_lot_acc_relate"/>
        </record>
        <record model="ir.action.keyword" id="act_lot_acc_relate_keyword_lot_report">
            <field name="keyword">form_relate</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_lot_acc_relate"/>
        </record>
        <menuitem
            parent="purchase.menu_purchase"
            action="act_lot_visgraph"
            sequence="299"
            id="menu_lot_graph"/>

        <record model="ir.action.wizard" id="act_unmatch">
            <field name="name">🔗 Unmatch</field>
            <field name="wiz_name">lot.unmatch</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_unmatch_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_unmatch"/>
        </record>

        <record model="ir.action.wizard" id="act_unship">
            <field name="name">🚢 Unship</field>
            <field name="wiz_name">lot.unship</field>
            <field name="model">lot.report</field>
        </record>
        <record model="ir.action.keyword" id="act_unship_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lot.report,-1</field>
            <field name="action" ref="act_unship"/>
        </record>
        
        <record model="ir.model.button" id="filters_button">
            <field name="model">lot.matching.start</field>
            <field name="name">filters</field>
            <field name="string">FILTERS</field>
        </record>
        <record model="ir.model.button-res.group" id="filters_button_group_admin">
            <field name="button" ref="filters_button"/>
            <field name="group" ref="res.group_admin"/>
        </record>
        <record model="ir.model.access" id="access_lot">
            <field name="model">lot.matching.start</field>
            <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_lot_admin">
            <field name="model">lot.matching.start</field>
            <field name="group" ref="res.group_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>

        <menuitem
            parent="purchase.menu_purchase"
            sequence="99"
            action="act_lot_report_form"
            id="menu_lot_report_form"/>
        <!-- <menuitem
            parent="purchase.menu_purchase"
            sequence="100"
            action="act_lot_form"
            id="menu_lot_form"/> -->
        <menuitem
            parent="purchase.menu_purchase"
            sequence="110"
            action="act_lot_fcr_form"
            id="menu_lot_fcr_form"/>

    </data>
</tryton>