代码之家  ›  专栏  ›  技术社区  ›  user2175784

扩展res.user以链接特定用户创建的类别

  •  0
  • user2175784  · 技术社区  · 7 年前

    使用继承视图扩展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>
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Keval Mehta    7 年前

    不添加 <sheet> 标记之前 <header> 标签就像击中一样

    <xpath>
    <header></header>
    <sheet></sheet>
    </xpath>
    

    您的xpath是正确的,只是做了此更改,它将正常工作