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

I have many 2one field like this <field name="contract_id" widget="selection" domain="[('partner_id','=',partner_id),('state','=','draft')]" required="1"/>

i am getting invalid architecture problem how to solve the issue

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

Unfortunately widget="selection" don't support dinamic domain.

If you need widget selection then remove from domain non static value like partner_id:

<field name="contract_id" widget="selection" domain="[('state','=','draft')]" required="1"/>

If you need domain with dinamic value you have to remove widget="selection":

<field name="contract_id" domain="[('partner_id','=',partner_id),('state','=','draft')]" required="1"/>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

u dont have to use widget="selection" just romove it and in py file u have to declare yr colum as 'contract_id': fields.selection()

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

how to use many2one to fields.selection ?

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 23
9779
1
thg 10 22
3891
0
thg 10 20
3329
1
thg 8 17
3800
8
thg 2 17
8427