<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="res_config_settings_view_form" model="ir.ui.view">
        <field name="name">res.config.settings.view.form.inherit.sale.block</field>
        <field name="model">res.config.settings</field>
        <field name="inherit_id" ref="sale.res_config_settings_view_form" />
        <field name="arch" type="xml">
            <xpath expr="//setting[@id='no_edit_order']" position="after">
                <setting
                    id="sale_line_field_block"
                    string="Blocking sales due to lack of stock"
                    help="Avoid selling more product than you have in stock or planned"
                    company_dependent="1"
                >
                    <div class="content-group">
                        <div class="mt-2">
                            <label
                                for="sale_line_field_block"
                                string="Field to compare against the quantity demanded"
                                class="w-100"
                            />
                            <field
                                name="sale_line_field_block"
                                options="{'no_create': True, 'no_open': True}"
                                class="w-75"
                            />
                        </div>
                        <div class="mt-1">
                            <label
                                for="sale_line_block_allowed_groups"
                                string="Groups allowed to bypass the block"
                                class="w-100"
                            />
                            <field
                                name="sale_line_block_allowed_groups"
                                widget="many2many_tags"
                                options="{'no_create': True, 'no_open': True}"
                                class="w-100"
                            />
                        </div>
                    </div>
                </setting>
            </xpath>
        </field>
    </record>
</odoo>
