Skip to Content
Menu
This question has been flagged
3 Replies
4537 Views

How can i hide the Tab "Optional Products" in Sales in Odoo 12?

i tried different xpath settings (page 1-4) to change the attribute invisible but nothing helped.

this tab was added in sales_management Module in Odoo (V12) but without a name (only string)

<xpath expr="//page[3]" position="attributes">   
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//notebook/page[3]" position="attributes">  
<attribute name="invisible">1</attribute>
<attribute name="autofocus"></attribute>
</xpath>
Avatar
Discard
Best Answer

Hi Jack,

You can do it with an xpath, you where on the quite good way actually. You could do the xpath cleaner and faster though (tested on runbot V12):

<xpath expr="//page[2]" position="replace"></xpath>

The bad part about these xpaths is that you're doing an xpath on an index, which means that as soon as you change configurations somewhere else or if you're adding pages that you might actually be hiding a tab you didn't want to. I've made an official change request for this so that there is a name set on this page for a cleaner xpath. You can find it at https://github.com/odoo/odoo/pull/27771. If this is accepted you could later on do a cleaner xpath:

<xpath expr="//page[@name='optional_products']" position="replace"></xpath>

Regards,
Yenthe

Avatar
Discard
Best Answer

I think you have given wrong count for page

page[1] means second tab, optional products

Avatar
Discard
Author

this only hides the Main-Article Tag within a sale. but not the "Optional Article"-Tab. i tried different numbers already

So the problem with Inheritance, If possible show your code for hiding (from record starting to ending)