Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3071 มุมมอง
<record id="view_res_partner_pricelist" model="ir.ui.view">
                <field name="name">view.res.partner.pricelist.form</field>
                <field name="model">res.partner</field>
                <field name="type">form</field>
                <field name="inherit_id" ref="product.view_partner_property_form" />
                <field name="context">{'readonly_by_pass': True}</field>
                <field name="arch" type="xml">

                    <xpath expr="//page[@name='accounting']" position="replace">
                                        </xpath>
        </field>
            </record>

this is my view where I hide tab Accounting, and it works ok if the user that opens contact form have accounting & finance access rights, but if the user doesn't have them then I get an error

AttributeError: Element '<xpath expr="//page[@name='accounting']">' cannot be located in parent view

Error context:
View `view.res.partner.pricelist.form`

how can I make this work for users who has and don't accounting and finances access rights?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Here you are inheriting child view . Inherit parent form view id :

E.g.

   

    <field name="inherit_id" ref="base.view_partner_form"/>

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 19
7300
1
มิ.ย. 24
1727
Select multiple elements with XPath แก้ไขแล้ว
5
ส.ค. 24
46805
2
เม.ย. 24
2620
3
มิ.ย. 23
5969