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

Hi.

I have a stock module with a view(A) and an inherited view(B).

I now want to inherit the inherited view with xml record (C) and remove 2 fields which were added by (B).

But i dont know how.

I tried to do an xpath on the fields added, but i get a "cannot be located" error.

Can someone help me?

Ảnh đại diện
Huỷ bỏ
Tác giả

i have in B:

<field name="categ_id" position="after">

<field name="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>

<field name="barcode" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>

</field>

and in C:

<xpath expr="//field[@name='default_code']" position="attributes">

<attribute name="attrs">{'invisible': True}</attribute>

</xpath>

<xpath expr="//field[@name='barcode']" position="attributes">

<attribute name="attrs">{'invisible': True}</attribute>

</xpath>

Tác giả Câu trả lời hay nhất

Hi.

I found the error:

I was inheriting from A in the same file that i was inheriting from B. There were two records, but somehow odoo did not like that. Now both records in a file each solved my problem.

Thanks

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

Hi,

In the inherit_id give the id of the inherited view B.

Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

thats what i did.

Then make sure that the fields used in xpath are from this inherited view itself

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 16
4814
2
thg 3 15
6256
1
thg 5 24
2344
0
thg 1 24
2280
2
thg 11 23
7231