コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
1722 ビュー

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.

関連投稿 返信 ビュー 活動
4
3月 24
3348
1
10月 23
5322
1
6月 22
6554
4
6月 21
15827
2
8月 17
12625