Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2044 Lượt xem

I'm trying to inherit views of buttons for specific group or multiple group and it is still not showing 

 in product.template.sale.order.button
 

and button in product.template_procurement

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Anton,


To Inherit the buttons and field from any view so you need to insure the correct view id which you inherited you need to also mention the correct module name  before the view id find out the steps for that


define the inherited view

//Code 1 in comment//


you can mention the correct module name with correct view id in the inherited view like


//Code 2 in comment//


The stock - is the module name

product_template_form_view_procurement_button - this is the view id


Give the xpath for to add the groups for the buttons and fields like you need to mention the correct name of the button and fields

//Code 3 in comment//


Hope this helps.

   

If you need any help in customization feel free to contact us.

       

Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ

Code 1:

<record model="ir.ui.view" id="product_template_form_view_procurement_button_inherit">
<field name="name">product.template_procurement.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_update_quantity_on_hand']" position="attributes">
<attribute name="groups">module_name.group_id</attribute>
</xpath>
</field>
</record>

Code 2 :

<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>

Code 3:

<xpath expr="//button[@name='action_update_quantity_on_hand']" position="attributes">
<attribute name="groups">module_name.group_id</attribute>
</xpath>

@name='add the correct button name inside the xpath expr'
<attribute name="groups">here you can mention the correct module name with correct group id</attribute>

Tác giả

What I'm actually inheriting is the

<div name="button_box" position="inside">
<t groups="stock.group_stock_user">

in product.template_procurement

Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 24
2621
1
thg 7 24
1135
2
thg 12 23
18295
1
thg 2 21
3015
1
thg 7 17
4294