使用继承视图扩展pos.category表单,如何使用xpath在表单的第一部分附加智能按钮
<record id="view_pos_category_inherited_form" model="ir.ui.view">
<field name="name">view.pos_category.inherited.form</field>
<field name="model">pos.category</field>
<field name="inherit_id" ref="point_of_sale.product_pos_category_form_view" />
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<sheet>
<header>
<button class="oe_stat_button" name="" icon="fa-th-list" type="action" context="{'search_default_create_uid': uid}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="user_categories_count"/></span>
<span class="o_stat_text"> Categories</span>
</div>
</button>
</header>
</sheet>
</xpath>
</field>
</record>
答案 0 :(得分:1)
请勿在{{1}}代码之前添加<sheet>
代码。只需像命中
<header>
你的xpath是正确的,只是做了这个改变,它会起作用