How to hide tabs in Tryton without disabling the module or reinstalling all?

Hi, I’m using Tryton and have activated a module that adds several tabs in a form view. However, I need to hide these tabs without disabling the module or reinstalling all modules. Since we know we cant disable the module.

I’ve tried looking into XML configurations and access control, but I haven’t found the right solution. What’s the best way to hide specific tabs in Tryton?

image

You can just extend the view and replace the tab by nothing. This will remove the tab directly. You can do it with something like this:

<xpath expr="/form/notebook/tab[@id='tab_to_replace']" position="replace"/>

Replacing may create troubles if other module relies on the content, so it is probably better to make it invisible with a states using ModelView.view_attributes.

I am trying to add a new tab to a form view in Tryton, but I encountered an issue when using position="replace" in my XML extension.

I get the following error:

AttributeError: Couldn't find tag (xpath: //field[@name="rh"]) in parent view!  

I also tried using:

<attribute name="invisible">1</attribute>  

But this prevents the tree view from opening the form.

How can I correctly add my tab without causing this issue? Is there a better way to make the field invisible?

This error is because there is no field named rh in the view you are extending and this causes an error as the system does not know which element should be extended.

                    <xpath expr="//field[@name='du']" position="attributes">
                      <attribute name="invisible">1</attribute>
                    </xpath>

Eventhough I do this, i can’t open the menu.

You should replace attributes if you want to update them. Something like:

<xpath expr="//field[@name='du']" position="replace_attributes">
    <field name="du" invisible="1"/>
</xpath>

Still stuck in this
image

Probably you have and error on some view definition, you should review your server logs.