Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2954 มุมมอง

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?


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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 >
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 15
13637
3
มี.ค. 25
2013
1
ส.ค. 24
2568
2
พ.ค. 24
3305
2
มี.ค. 22
10206