Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1714 มุมมอง

How can i inherit this part of product.template_procurement view form? 


I just want to add another group.

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

Hi, 

Please try this below code.

<xpath expr="//div[@name='button_box']/t[@groups='stock.group_stock_user']" position="attributes">

<attribute name="groups">stock.group_stock_user,new_group.group_users</attribute>

<xpath>




อวตาร
ละทิ้ง
ผู้เขียน

Very much thanks for this!

คำตอบที่ดีที่สุด

Hi,


By inheriting the view using the actual external ID of the view you want to inherit and use xpath to add any div or t inside a view at a specific position.

For example refer the following code:


<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_product_template_procurement_form_inherit" model="ir.ui.view">
<field name="name">product.template.procurement.form.inherit</field>
<field name="model">product.template.procurement</field>
<field name="inherit_id" ref="product.product_template_procurement_form_view"/>
        <field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<t groups="stock.group_stock_user">
                    <field name="tracking" invisible="1"/>
                    <!-- New group you want to add -->
                    <group>
                        <field name="your_field_name"/>
                    </group>
                </t>
            </xpath>
        </field>
    </record>
</odoo>


Hope it helps.




อวตาร
ละทิ้ง
ผู้เขียน

It didn't work.

What i want is to inherit the whole button boxes. Which is div. I tried to add the group in product.template_procurement (withouth inheriting) <t groups="stock.group_stock_user, new_group.group_users">, and it did work. That is why i want to inherit the whole div.

Related Posts ตอบกลับ มุมมอง กิจกรรม
4
มี.ค. 24
3341
1
ต.ค. 23
5308
1
มิ.ย. 22
6550
How to inherits only one fields แก้ไขแล้ว
4
มิ.ย. 21
15821
2
ส.ค. 17
12623