Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3377 Vizualizări

How to hide button Favorites in odoo 16?

I have tried but it's failed  

Someone help me please !!!

Imagine profil
Abandonează
Cel mai bun răspuns

 


 


If you want to hide the Favorites dropdown menu which showing beside "Group By" dropdown menu, you need to override the owl xml template is below:


In you custom addon, you will add the favorites_menu.xml any your custom addon and its prefer to be added in the following path static/src/xml/favorites_menu.xml and then add the below code to this created file:


<templates>
    <t t-name="FavoriteMenu" t-inherit="web.FavoriteMenu" t-inherit-mode="extension" owl="1">
        <xpath expr="//Dropdown" position="replace">
            <Dropdown class="'o_favorite_menu btn-group'" togglerClass="'btn btn-light'">
                <t t-set-slot="toggler">


                </t>
            </Dropdown>
        </xpath>
    </t>
</templates>
                                  
Then add the below lines in your custom addon manifest file and replace YOUR_MODULE_NAME with you custom addon name:


    'assets': {
        'web.assets_backend': [
            'YOUR_MODULE_NAME/static/src/xml/favorites_menu.xml',
        ]


    },


Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

If that button exists in sale.order just inherit and give attribute

Sample Code

<odoo>
<data>
<record id="my_sale_order_form_view" model="ir.ui.view">
<field name="name">sale.order.form.inherited</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sales_order_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_favorite']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</data>

</odoo>

Regards

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
aug. 22
2494
1
sept. 24
1653
1
apr. 25
1351
Odoo App Rezolvat
1
nov. 23
1917
0
mai 24
1655