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

field name="projects" invisible="'parent'=False"
can anyone please help me what's wrong with syntax ....

Actually I'm not getting any syntax error but its not executing so anyone know odoo 17, please help


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất
field name="projects" invisible="not parent"


this is actually an syntax issue above code solved my issue... thank you for your suggestions

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

In Odoo 17, the syntax for an invisible field has changed.  

It changed from 

"(['myfield','==','blue'])"

to

"myfield=='blue'"


See https://www.odoo.com/documentation/17.0/developer/reference/user_interface/view_architectures.html#


and jump to the detail by searching for  Whether the element is visible (False) or hidden (True)

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

Hi 

In odoo 17 instead of attrs try as following 

field name=”field_name” invisible=”state != ‘draft’ ”  readonly=”state == ‘confirm’"

if it is for fields inside a one2many field,


field name="vehicle_id" column_invisible="parent.move_id not in ('out_invoice','out_refund')"



Regards




Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 25
1392
2
thg 4 17
3526
0
thg 5 24
1199
0
thg 4 24
1347
1
thg 4 24
2582