Hello guys i have added a field in res.partner view and i want to hide some buttons in the header of res.partner view base on some conditions related to the field i've added and those buttons are added by inherited view i tried somthings but not working so if any one knows how to do it respond please 😊
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
thanks for the respond brother im using odoo 18 and i found the solution thanks a lot
Hi,
Please check the code below:
<record id="view_partner_form" model="ir.ui.view">
<field name="name">res.partner.view.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath
expr="//div[hasclass('oe_button_box')]/button[@name='your_button_name']"
position="attributes">
<attribute name="invisible">Your condition</attribute>
</xpath>
</field>
</record>
Hope it helps.
Hello,
You can customize ths code or send us your fields and the conditions you want
<xpath expr="//header/button[@name='your_button_action']" position="replace">
<button name="your_button_action" string="Your Button"
attrs="{'invisible': [('your_field', '=', False)]}"/>
</xpath>
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
1
mag 25
|
707 | ||
|
3
mar 25
|
925 | ||
|
0
nov 24
|
923 | ||
|
11
gen 24
|
13333 | ||
|
2
mar 15
|
8542 |