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
- ํ๊ณ
- ์ฌ๊ณ ๊ด๋ฆฌ
- PoS
- ํ๋ก์ ํธ
- MRP
์ ๊ณ ๋ ์ง๋ฌธ์ ๋๋ค
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>
ํ ๋ก ์ด ์ฌ๋ฏธ์์ผ์ ๊ฐ์? ์ง์ ์ฐธ์ฌํด๋ณด์ธ์!
์ง๊ธ ๋ฐ๋ก ๊ฐ์ ํ์ฌ ๋ ์ ์๋น์ค๋ฅผ ์ด์ฉํด๋ณด๊ณ ํน๋ณํ ์ปค๋ฎค๋ํฐ์ ์ํตํ์ธ์!
๊ฐ์| ๊ด๋ จ ๊ฒ์๋ฌผ | ๋ต๊ธ | ํ๋ฉด | ํ๋ | |
|---|---|---|---|---|
|
|
1
5์ 25
|
1573 | ||
|
Hide On-time Rate button in res.partner view
ํด๊ฒฐ ์๋ฃ
|
|
3
3์ 25
|
2917 | |
|
|
0
11์ 24
|
2145 | ||
|
Creating new view from a old view
ํด๊ฒฐ ์๋ฃ
|
|
11
1์ 24
|
14557 | |
|
|
2
3์ 15
|
9568 |