<?xml version="1.0"?>
<odoo>
    <!--Add the field for enabling the out-of-stock product restrict -->
    <record id="res_config_settings_view_form" model="ir.ui.view">
        <field name="name">
            res.config.settings.view.form.inherit.sale.stock.restrict
        </field>
        <field name="model">res.config.settings</field>
        <field name="priority" eval="40"/>
        <field name="inherit_id" ref="sale.res_config_settings_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//div[hasclass('settings')]//div[@id='connectors_setting_container']"
                   position="after">
                <h2 class="mt32">Out Of Stock Product Restriction</h2>
                <div class="row mt16 o_settings_container"
                     id="product_restriction">
                    <div class="col-12 col-lg-6 o_setting_box"
                         id="out_of_stock_product_restriction">
                        <div class="o_setting_left_pane">
                            <field name="product_restriction"/>
                        </div>
                        <div class="o_setting_right_pane">
                            <label for="product_restriction"/>
                        </div>
                        <div class="o_setting_right_pane"
                             attrs="{'invisible':[('product_restriction','!=',True)]}">
                            <label for="check_stock"/>
                            <field name="check_stock"/>
                        </div>
                    </div>
                </div>
            </xpath>
        </field>
    </record>
</odoo>