Add tab to variants

Hi there

Currently I am fighting to show a blank new tab in Products > Variant.

product.xml

<?xml version="1.0"?>
<tryton>
    <data>
        <record model="ir.ui.view" id="product_view_form">
            <field name="model">product.product</field>
            <field name="inherit" ref="product.product_view_form"/>
            <field name="name">product_form</field>
        </record>
</tryton>

product_form.xml

<?xml version="1.0"?>
<data>
    <xpath expr="/form/notebook/page[@id='general']" position="after">
        <page name="cross_selling" string="Cross Selling">
        </page>
    </xpath>
</data>

product.py

from trytond.model import fields, ModelSQL, ModelView
from trytond.pool import PoolMeta


class Product(metaclass=PoolMeta):
    __name__ = 'product.product'

tryton.cfg

[tryton]
version=7.8.0
depends:
    ir
    product
xml:
    product.xml

[register]
model:
    product.Product

What do I miss? As first step I just want to show a new tab without fields. For sure fields will follow.

Thanks for any hints

q

The reason your new tab is missing is that Tryton does not render completely empty tabs. Since there are no fields or visual elements inside your , the GUI framework hides it by default.

It is designed this way so that if a tab contains fields, but all of them become hidden—either due to PYSON domain conditions (states={‘invisible’: …}) or because the user lacks read access permissions—the entire tab automatically hides itself to avoid showing an empty, useless tab to the user.