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

Hi everyone! I'm having trouble trying select the city field from a res.partner inherited form view in Odoo 14.


This issue doesn's show up with other field from the same view.


Example:

<field name="city" position="after">Hi!</field>

produces nothing.


But

<field name="street" position="after">Hi!</field>

shows "Hi!" after the street field, as expected.


Can anyone help me?


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

I've found the solution by observing the View Field item in the Debug menu.


I've discovered a city_id hide parameter. So:

<xpath expr="//div//field[@name='street2']" position="after">

< field name="city_id" invisible="1" / >

< /xpath >

< field name="city" position="attributes" >

< attribute name="attrs" > {'readonly': ['|','&', ('type', '=', 'contact'), ('parent_id', '!=', False), ('x_some_field', '!=', 0)]} < /attribute >

< /field >
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 15
13395
3
thg 3 25
1344
1
thg 8 24
2352
2
thg 5 24
3089
2
thg 3 22
9992