XPath doesn’t take any effect without throwing any errors

so this is the first time I really struggle on something and need to consult stackoverflow personally instead just grabbing information from existing threads.

I want to make a button in 2 of our views only visible to users of a specific group. In the sale.order view everything works as intended. There is similar view in the account.move model which I inherited the same way I did with the sales.order view.

This is the view thats works correctly

<odoo>
    <record id="view_sale_order_form_extension" model="ir.ui.view">
        <field name="name">sale.order.form.extension</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale_commission.view_order_agent_form_inherit"/>
        <field name="arch" type="xml">
            <xpath expr="//button[@name='button_edit_agents'][@icon='fa-users']"
                   position="attributes">
                <attribute name="groups">sale_commission.group_sales_agent</attribute>
            </xpath>
        </field>
    </record>
</odoo>

And this one doesn’t

<odoo>
    <record id="view_account_move_form_extension" model="ir.ui.view">
        <field name="name">sale.commission.view.move.form.extension</field>
        <field name="model">account.move</field>
        <field name="inherit_id" ref="sale_commission.view_move_form"/>
        <field name="arch" type="xml">
            <xpath expr="//button[@name='button_edit_agents'][@icon='fa-users']"
                   position="attributes">
                <attribute name="groups">sale_commission.group_sales_agent</attribute>
            </xpath>
        </field>
    </record>
</odoo>

The button is also added via XPath through an inherited view, this is how it is implemented:

<xpath expr="//field[@name='invoice_line_ids']/tree//field[@name='price_subtotal']" position="after">
<button name="button_edit_agents" icon="fa-users" attrs="{'invisible': [                         '|',('commission_free', '=', True),('any_settled', '=', True),],'column_invisible': [('parent.move_type', 'not in', ['out_invoice', 'out_refund'])]}" type="object"/>
</xpath>

It doesn’t give me any errors, when I change the name of the button in the last view it also tells me that I can’t find the button. Also I see that the view is correctly registered as an inherited view of the view I wanted to inherit.

I am out of ideas right now, I think it must be something very simple and stupid that I can’t see or not know about. So any idea how to debug this problem further would be a great help!

Thank you guys

I tried to:

  • restart the server and also the vm, so I do not have any cache problems
  • trying to use a wrong button name within the xpath to check if it throws an error (it does, so it really finds the view and the button as it seems)
  • using different users with different groups
  • I also tried to make it invisible=1 instead just adding a group tag to check if this will work, it also doesn’t

New contributor

pycal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật