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

want to delete the Inventory page of product.product_template_form_view but it gives me this error

error
AttributeError: element '<div name="weight">' cannot be located in view parent

Contexte de l'erreur :
Vue `product.template.stock.property.form.inherit`
[view_id: 833, xml_id: stock.view_template_property_form, model: product.template, parent_id: 303]

here is my code using the xpath expression

<record id="view_product_form_inherit" model="ir.ui.view">

<field name="name">product.template.common.form.inherit</field>

<field name="model">product.template</field>

<field name="inherit_id" ref="product.product_template_form_view"/>

<field name="arch" type="xml">

</xpath>

<xpath expr="//page[2]" position="replace">

</xpath>

  </field>

</record>

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

Hello,


Try using this

<record id="view_product_form_inherit" model="ir.ui.view">

<field name="name">product.template.common.form.inherit</field>

<field name="model">product.template</field>

<field name="inherit_id" ref="product.product_template_form_view"/>

<field name="arch" type="xml">

</xpath>

<xpath expr="//page[2]" position="attributes">

             <attribute name="invisible">1</attribute>

         </xpath>

  </field>

</record>

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

thanks it worked :) without need to modify any other module  just hiding the page great 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
7
thg 1 16
8274
1
thg 12 24
6212
3
thg 8 24
7058
4
thg 7 24
41467
5
thg 4 23
99408