<?xml version="1.0" encoding="UTF-8" ?>
<!--
    Copyright 2020 ForgeFlow S.L. (http://www.forgeflow.com)
    License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
-->
<odoo>
    <record id="res_config_settings_view_form" model="ir.ui.view">
        <field name="name">res.config.settings.view.form.inherit.ddmrp</field>
        <field name="model">res.config.settings</field>
        <field name="inherit_id" ref="base.res_config_settings_view_form" />
        <field name="arch" type="xml">
            <xpath expr="//div[hasclass('settings')]" position="inside">
                <div
                    class="app_settings_block"
                    data-string="DDMRP"
                    string="DDMRP"
                    data-key="ddmrp"
                    groups="ddmrp.group_ddmrp_manager"
                >
                    <h2>Extensions</h2>
                    <div class="row mt16 o_settings_container" id="ddmrp_extension">
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="module_ddmrp_history" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label
                                    string="DDMRP History"
                                    for="module_ddmrp_history"
                                />
                                <div class="text-muted">
                                    Store historical data from stock buffers.
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="module_ddmrp_adjustment" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label
                                    string="DDMRP Adjustments"
                                    for="module_ddmrp_adjustment"
                                />
                                <div class="text-muted">
                                    Apply adjustments to dynamically alter stock buffers to respond to planned or anticipated events.
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="module_ddmrp_coverage_days" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label
                                    string="Show Coverage Days in Stock Buffers"
                                    for="module_ddmrp_coverage_days"
                                />
                                <div class="text-muted">
                                    Shows the current on-hand for stock buffers expressed as coverage days.
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="module_ddmrp_packaging" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label
                                    string="Stock Buffers &amp; Packagings"
                                    for="module_ddmrp_packaging"
                                />
                                <div class="text-muted">
                                    Use packagings on stock buffers.
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="module_stock_buffer_capacity_limit" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label for="module_stock_buffer_capacity_limit" />
                                <div class="text-muted">
                                    Set an storage capacity limit on stock buffers.
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="module_ddmrp_chatter" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label for="module_ddmrp_chatter" />
                                <div class="text-muted">
                                    Adds chatter and activities to stock buffers.
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field
                                    name="module_ddmrp_purchase_hide_onhand_status"
                                />
                            </div>
                            <div class="o_setting_right_pane">
                                <label for="module_ddmrp_purchase_hide_onhand_status" />
                                <div class="text-muted">
                                    Hides on-hand status from purchase order line.
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="module_ddmrp_warning" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label for="module_ddmrp_warning" />
                                <div class="text-muted">
                                    Get configuration warnings for stock buffers.
                                </div>
                            </div>
                        </div>
                    </div>
                    <h2>Company Settings</h2>
                    <div class="row mt16 o_settings_container" id="ddmrp_settings">
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="ddmrp_auto_update_nfp" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label
                                    string="Auto update Net Flow Position"
                                    for="ddmrp_auto_update_nfp"
                                />
                                <span
                                    class="fa fa-lg fa-building-o"
                                    title="Values set here are company-specific."
                                    role="img"
                                    aria-label="Values set here are company-specific."
                                    groups="base.group_multi_company"
                                />
                                <div class="text-muted">
                                    Transfer status changes can trigger the update of relevant buffer's NFP.
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-12 col-md-6 o_setting_box">
                            <div class="o_setting_left_pane">
                                <field name="ddmrp_adu_calc_include_scrap" />
                            </div>
                            <div class="o_setting_right_pane">
                                <label for="ddmrp_adu_calc_include_scrap" />
                            </div>
                        </div>
                        <div class="col-12 col-lg-6 o_setting_box">
                            <div class="o_setting_left_pane" />
                            <div class="o_setting_right_pane">
                                <label for="ddmrp_qty_multiple_tolerance" />
                                <span
                                    class="fa fa-lg fa-building-o"
                                    title="Values set here are company-specific."
                                    role="img"
                                    aria-label="Values set here are company-specific."
                                    groups="base.group_multi_company"
                                />
                                <div class="text-muted">
                                    Set a tolerance value to apply to quantity multiple in stock buffers.
                                    If the quantity needed is below this tolerance threshold, the recommended
                                    quantity will be reduced a bit instead of adding another bucket.
                                    The value is a percentage of the quantity multiple.
                                    <field name="ddmrp_qty_multiple_tolerance" />%
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </xpath>
        </field>
    </record>
    <record id="action_ddmrp_config" model="ir.actions.act_window">
        <field name="name">Settings</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">res.config.settings</field>
        <field name="view_mode">form</field>
        <field name="target">inline</field>
        <field name="context">{'module' : 'ddmrp'}</field>
    </record>
</odoo>
