Reputation: 31
I tried this code but nothing happened:
#view.xml
<odoo>
<data>
<record id="view_pos_config_kanban_inherit" model="ir.ui.view">
<field name="name">pos.config.inherit</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.view_pos_config_kanban"/>
<field name="arch" type="xml">
<xpath expr="//kanban/templates/t/div/div[3][contains(@class='o_kanban_manage_button_section')]" position="replace">
</xpath>
</field>
</record>
</data>
</odoo>
Upvotes: 2
Views: 281
Reputation: 31
My Solution:
<odoo>
<data>
<record id="view_pos_config_kanban" model="ir.ui.view">
<field name="name">pos.config.kanban.view</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.view_pos_config_kanban"/>
<field name="arch" type="xml">
<xpath expr="//kanban/templates/t/div/div[1]/div[2][@class='o_kanban_manage_button_section']" position="replace">
</xpath>
</field>
</record>
</data>
</odoo>
Upvotes: 1
Reputation: 26698
Odoo will raise odoo.tools.convert.ParseError: "Invalid number of arguments"
because of contains
function used in div
.
You can check in the XPath documentation provided by Odoo that contains
is a function to manipulate strings:
contains(s1, s2)
returns true if s1 contains s2
Use XPath
to locate the div
with o_kanban_manage_button_section
class and make it invisible.
Example:
<record id="view_pos_config_kanban" model="ir.ui.view">
<field name="name">pos.config.kanban.view</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.view_pos_config_kanban"/>
<field name="arch" type="xml">
<xpath expr="//t/div/div/div[@class='o_kanban_manage_button_section']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
</field>
</record>
Upvotes: 1