<?xml version="1.0"?>
<form string="Pricelist Rule">
                <sheet>
                    <field name="name" invisible="1"/>
                    <field name="company_id" invisible="1"/>
                    <field name="price" invisible="1"/>
                    <field name="applied_on" invisible="1"/>
                    <group name="pricelist_rule_computation">
                        <group name="pricelist_rule_method">
                            <field name="display_applied_on" string="Apply To" widget="radio" options="{'horizontal': true}"/>
                            <field name="categ_id" options="{'no_create':1}" invisible="display_applied_on != '2_product_category'" placeholder="All categories"/>
                            <field name="product_tmpl_id" options="{'no_create':1}" invisible="display_applied_on != '1_product'" placeholder="All products"/>
                            <field name="product_variant_count" invisible="1"/>
                            <field name="product_id" options="{'no_create':1}" invisible="product_variant_count &lt; 2" placeholder="All variants"/>
                            <field name="compute_price" string="Price Type" widget="radio" options="{'horizontal': true}" invisible="display_applied_on == '1_product' and compute_price == 'fixed_price'"/>
                            <label for="fixed_price" invisible="compute_price != 'fixed'"/>
                            <div class="o_row" invisible="compute_price != 'fixed'" style="width: 60% !important;">
                                <field name="fixed_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>
                                <span class="d-flex gap-2 p-0" invisible="not product_uom ">per<field name="product_uom"/></span>
                            </div>
                            <label for="percent_price" string="Discount" invisible="compute_price != 'percentage'"/>
                            <div class="o_row gap-3" invisible="compute_price != 'percentage'">
                                <field name="percent_price"/>
                                <span>%</span>
                                <span>on</span>
                                <field name="base_pricelist_id" placeholder="sales price"/>
                            </div>
                        </group>
                        <group name="pricelist_rule_limits">
                            <field name="min_quantity" string="Min Qty"/>
                            <field name="date_start" string="Validity Period" widget="daterange" options="{'end_date_field': 'date_end'}"/>
                            <field name="date_end" invisible="1"/>
                        </group>
                    </group>
                    <group name="pricelist_rule_base" invisible="compute_price != 'formula'">
                        <group>
                            <field name="base" string="Based price"/>
                            <field name="base_pricelist_id" invisible="base != 'pricelist'" readonly="base != 'pricelist'" required="compute_price == 'formula' and base == 'pricelist'" string="Other Pricelist"/>
                            <label for="price_discount" string="Discount" invisible="base == 'standard_price'"/>
                            <div class="o_row" invisible="base == 'standard_price'" style="width: 40% !important;">
                                <field name="price_discount"/>
                                <span>%</span>
                            </div>
                            <label for="price_markup" string="Markup" invisible="base != 'standard_price'"/>
                            <div class="o_row" invisible="base != 'standard_price'" style="width: 40% !important;">
                                <field name="price_markup"/>
                                <span>%</span>
                            </div>
                            <field name="price_round" string="Round off to"/>
                            <field name="price_surcharge" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>
                            <label string="Margins" for="price_min_margin" groups="base.group_no_one"/>
                            <div class="d-flex align-items-baseline" groups="base.group_no_one">
                                <field name="price_min_margin" string="Min. Margin" class="oe_inline" widget="monetary" options="{'field_digits': True}"/>
                                <i class="fa fa-long-arrow-right mx-2 oe_edit_only" aria-label="Arrow icon" title="Arrow"/>
                                <field name="price_max_margin" string="Max. Margin" class="oe_inline" widget="monetary" nolabel="1" options="{'field_digits': True}"/>
                            </div>
                        </group>
                        <div>
                            <div class="alert alert-info" role="alert" style="white-space: pre;">
                                <field name="rule_tip"/>
                            </div>
                            <div class="alert alert-info" role="alert" style="white-space: pre;">
                                <b>Tip: want to round at 9.99?</b>
                                <div>round off to 10.00 and set an extra at -0.01</div>
                            </div>
                        </div>
                    </group>

                    <group string="Company Settings" groups="base.group_no_one">
                        <group name="pricelist_rule_related">
                            <field name="pricelist_id" invisible="1"/>
                            <field name="currency_id" groups="base.group_multi_currency"/>
                            <field name="company_id" groups="base.group_multi_company"/>
                        </group>
                    </group>
                </sheet>
            </form>
        