<?xml version="1.0" encoding="utf-8"?>

<odoo>
    <data>
<!-- Views-->
        <record id='ventor_settings_tree_view' model='ir.ui.view'>
            <field name="name">Ventor Settings</field>
            <field name="model">ventor.option.setting</field>
            <field name="priority">1000</field>
            <field name="arch" type="xml">
                <tree create="false" editable="top">
                    <field name="name" readonly="1"/>
                    <field name="technical_name" readonly="1"/>
                    <field name="settings_dependency" invisible="1"/>
                    <field name="value" attrs="{'readonly': [('technical_name','=','show_next_product')]}" options="{'no_create': True, 'no_open': True}"/>
                    <field name="value_type" readonly="1" groups="base.group_no_one"/>
                    <field name="action_type" readonly="1" groups="base.group_no_one"/>
                    <field name="description" readonly="1"/>
                </tree>
            </field>
        </record>

<!-- Actions-->
        <record id='ventor_package_management_action' model='ir.actions.act_window'>
            <field name="name">Package Management</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'package_management')]</field>
        </record>

        <record id='ventor_batch_picking_action' model='ir.actions.act_window'>
            <field name="name">Batch Picking</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'batch_picking'), ('technical_name', '!=', 'show_next_product')]</field>
        </record>

        <record id='ventor_wave_picking_action' model='ir.actions.act_window'>
            <field name="name">Wave Picking</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'wave_picking'), ('technical_name', '!=', 'show_next_product')]</field>
        </record>

        <record id='ventor_cluster_picking_action' model='ir.actions.act_window'>
            <field name="name">Cluster Picking</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'cluster_picking'), ('technical_name', '!=', 'show_next_product')]</field>
        </record>

        <record id='ventor_internal_transfers_action' model='ir.actions.act_window'>
            <field name="name">Internal Transfers</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'internal_transfers')]</field>
        </record>

        <record id='ventor_putaway_action' model='ir.actions.act_window'>
            <field name="name">Putaway</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'putaway')]</field>
        </record>

        <record id='ventor_inventory_adjustments_action' model='ir.actions.act_window'>
            <field name="name">Inventory Adjustments</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'inventory_adjustments')]</field>
        </record>

        <record id='ventor_instant_inventory_action' model='ir.actions.act_window'>
            <field name="name">Instant Inventory</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'instant_inventory')]</field>
        </record>

        <record id='ventor_quick_info_action' model='ir.actions.act_window'>
            <field name="name">Quick info</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'quick_info')]</field>
        </record>

        <record id='ventor_scrap_management_action' model='ir.actions.act_window'>
            <field name="name">Scrap Management</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'scrap_management')]</field>
        </record>

        <record id='ventor_create_so_action' model='ir.actions.act_window'>
            <field name="name">Create SO</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'create_so')]</field>
        </record>

        <record id='ventor_create_po_action' model='ir.actions.act_window'>
            <field name="name">Create PO</field>
            <field name="res_model">ventor.option.setting</field>
            <field name="view_mode">tree</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="ventor_settings_tree_view"/>
            <field name="domain">[('action_type', '=', 'create_po')]</field>
        </record>

<!-- Menus -->
        <menuitem name="Package Management"
                  id="ventor_package_management_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_package_management_action"
                  sequence="1"/>

        <menuitem name="Batch Picking"
                  id="ventor_batch_picking_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_batch_picking_action"
                  sequence="2"/>

        <menuitem name="Wave Picking"
                  id="ventor_wave_picking_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_wave_picking_action"
                  groups="stock.group_stock_picking_wave"
                  sequence="3"/>

        <menuitem name="Cluster Picking"
                  id="ventor_cluster_picking_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_cluster_picking_action"
                  sequence="4"/>

        <menuitem name="Internal Transfers"
                  id="ventor_internal_transfers_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_internal_transfers_action"
                  sequence="5"/>

        <menuitem name="Putaway"
                  id="ventor_putaway_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_putaway_action"
                  sequence="6"/>

        <menuitem name="Inventory Adjustments"
                  id="ventor_inventory_adjustments_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_inventory_adjustments_action"
                  sequence="7"/>

        <menuitem name="Instant Inventory"
                  id="ventor_instant_inventory_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_instant_inventory_action"
                  sequence="8"/>

        <menuitem name="Quick info"
                  id="ventor_quick_info_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_quick_info_action"
                  sequence="9"/>

        <menuitem name="Scrap Management"
                  id="ventor_scrap_management_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_scrap_management_action"
                  sequence="10"/>

        <menuitem name="Create SO"
                  id="ventor_create_so_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_create_so_action"
                  sequence="11"/>

        <menuitem name="Create PO"
                  id="ventor_create_po_app_menu"
                  parent="ventor_base.ventor_settings_app_menu"
                  action="ventor_create_po_action"
                  sequence="12"/>
    </data>
</odoo>
