<?xml version="1.0"?>
<form string="Product">
                <header>
                    <button string="Print Labels" type="object" name="action_open_label_layout" invisible="type == 'service'"/>
                </header>
                <sheet name="product_form">
                    <field name="product_variant_count" invisible="1"/>
                    <field name="is_product_variant" invisible="1"/>
                    <field name="attribute_line_ids" invisible="1"/>
                    <field name="company_id" invisible="1"/>
                    <div class="oe_button_box" name="button_box">
                        <button class="oe_stat_button" name="open_pricelist_rules" icon="fa-list-ul" groups="product.group_product_pricelist" type="object">
                               <div class="o_field_widget o_stat_info">
                                    <span class="o_stat_value o_row">
                                        <field name="pricelist_item_count"/>
                                        <span class="o_stat_text" invisible="pricelist_item_count == 1">
                                            Rules
                                        </span>
                                        <span class="o_stat_text" invisible="pricelist_item_count != 1">
                                            Rule
                                        </span>
                                    </span>
                                    <span class="o_stat_text" invisible="pricelist_item_count == 1">
                                        Pricelists
                                    </span>
                                    <span class="o_stat_text" invisible="pricelist_item_count != 1">
                                        Pricelist
                                    </span>
                               </div>
                        </button>
                        <!-- Dummy tag for organizing buttons, using position='replace' when inheriting -->
                        <span id="button_website" invisible="1"/>
                        <button class="oe_stat_button" name="action_open_documents" type="object" icon="fa-file-text-o">
                            <field string="Documents" name="product_document_count" widget="statinfo"/>
                        </button>
                    </div>
                    <widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
                    <field name="id" invisible="True"/>
                    <field name="image_1920" widget="image" class="oe_avatar" options="{'convert_to_webp': True, 'preview_image': 'image_128'}"/>
                    <div class="oe_title">
                        <label for="name" string="Product"/>
                        <h1>
                            <div class="d-flex">
                                <field name="is_favorite" widget="boolean_favorite" class="me-3" nolabel="1"/>
                                <field class="text-break" name="name" options="{'line_breaks': False}" widget="text" placeholder="e.g. Cheese Burger"/>
                            </div>
                        </h1>
                    </div>
                    <div name="options">
                        <span class="d-inline-flex">
                            <field name="sale_ok"/>
                            <label for="sale_ok"/>
                        </span>
                    </div>
                    <notebook>
                        <page string="General Information" name="general_information">
                            <group>
                                <group name="group_general">
                                    <field name="active" invisible="1"/>
                                    <field name="type" widget="radio" options="{'horizontal': True}"/>
                                    <field name="combo_ids" widget="many2many_tags" placeholder="e.g. Starter - Meal - Desert" invisible="type != 'combo'" options="{                                             'no_quick_create': True,                                             'edit_tags': True,                                         }"/>
                                    <field name="service_tracking" invisible="1 or type != 'service'"/>
                                    <field name="product_tooltip" class="fst-italic text-muted" string="" invisible="not product_tooltip"/>
                                </group>
                                <group name="group_standard_price">
                                    <label for="list_price"/>
                                    <div name="list_price_uom">
                                        <field name="list_price" class="oe_inline" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>
                                        <span name="uom_span" groups="uom.group_uom" invisible="type == 'combo'">
                                            per
                                            <field name="uom_id" class="oe_inline" style="max-width:136px" options="{'no_create': True}"/>
                                        </span>
                                    </div>

                                    <!--
                                        `id` condition to prevent invisibility on new products
                                        when `product_variant_count` is 0.
                                        `product_variant_count != 1` to handle cases with dynamic
                                        / multiple variants since id will be set after saving.
                                        #TODO : revert this and create a compute field in master
                                        to ensure invisivility for dynamic variants only.
                                    -->
                                    <label for="standard_price" invisible="(id and product_variant_count != 1                                                     and not is_product_variant) or type == 'combo'" id="standard_price_label"/>
                                    <div name="standard_price_uom" invisible="(id and product_variant_count != 1                                                     and not is_product_variant) or type == 'combo'">
                                        <field name="standard_price" class="oe_inline" widget="monetary" options="{                                                 'currency_field': 'cost_currency_id',                                                 'field_digits': True,                                             }"/>
                                        <span groups="uom.group_uom">
                                            per
                                            <field name="uom_name" class="oe_inline"/>
                                        </span>
                                    </div>
                                    <field name="categ_id" string="Category"/>
                                    <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" placeholder="Visible to all"/>
                                    <field name="currency_id" invisible="1"/>
                                    <field name="cost_currency_id" invisible="1"/>
                                    <field name="product_variant_id" invisible="1"/>
                                </group>
                            </group>
                            <group name="internal_notes" string="Internal Notes">
                                <field colspan="2" name="description" nolabel="1" placeholder="This note is only for internal purposes."/>
                            </group>
                        </page>
                        <page string="Sales" name="sales" invisible="1 or not sale_ok">
                            <group name="sale">
                                <group string="Upsell &amp; Cross-Sell" name="upsell" invisible="1"/>
                                <group name="extra_info" string="Extra Info">
                                    <field name="product_tag_ids" widget="many2many_tags" context="{'product_template_id': id}"/>
                                </group>
                            </group>
                            <group>
                                <group string="Quotation Description" name="description">
                                    <field colspan="2" name="description_sale" nolabel="1" placeholder="This note is added to sales orders and invoices."/>
                                </group>
                            </group>
                        </page>
                        <page string="Purchase" name="purchase" invisible="1 or not purchase_ok or type == 'combo'" groups="uom.group_uom">
                            <group name="purchase">
                                <group string="Vendor Bills" name="bill">
                                    <field name="uom_po_id" groups="uom.group_uom" options="{'no_create': True}"/>
                                </group>
                            </group>
                        </page>
                        <page string="Inventory" name="inventory" groups="product.group_stock_packaging" invisible="type in ['service', 'combo']">
                            <group name="inventory">
                                <group name="group_lots_and_weight" string="Logistics" invisible="type != 'consu'">
                                    <label for="weight" invisible="product_variant_count &gt; 1 and not is_product_variant"/>
                                    <div class="o_row" name="weight" invisible="product_variant_count &gt; 1 and not is_product_variant">
                                        <field name="weight" class="oe_inline"/>
                                        <field name="weight_uom_name"/>
                                    </div>
                                    <label for="volume" invisible="product_variant_count &gt; 1 and not is_product_variant"/>
                                    <div class="o_row" name="volume" invisible="product_variant_count &gt; 1 and not is_product_variant">
                                        <field name="volume" string="Volume" class="oe_inline"/>
                                        <field name="volume_uom_name"/>
                                    </div>
                                </group>
                            </group>
                            <group name="packaging" string="Packaging" colspan="4" invisible="(type != 'consu' or product_variant_count &gt; 1) and not is_product_variant" groups="product.group_stock_packaging">
                                <field colspan="2" name="packaging_ids" nolabel="1" context="{'list_view_ref':'product.product_packaging_tree_view2', 'default_company_id': company_id}"/>
                            </group>
                        </page>
                    </notebook>
                </sheet>
                <chatter/>
            </form>
        