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

Hi I need to remove or disable search option in many2one widget. I'm using openerp version 6.1 Any help...thanks in advanced.

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

Sorry that this is almost a decade late, but for anyone that's still searching:

You can use domains to achieve this functionality

e.g.

<field name="job_id" domain="[('id', '=', -1)]"/>

Applying a domain that returns no results, as seen in the example, essentially forces the user to create a new record in order to select a value for this field.

Good luck!


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

Adding widget="selection" in xml against many2one field should solve your problem

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

Thanks for answer my question, but i can't use that solution, because I need to create and edit elements in that widget. There is a way to disable Create option: attrs="{'nocreate':[('coordenada_id','!=','')]", I need something similar with Search option . Any help will be welcome....pd: sorry my English.

Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 9 20
9094
0
thg 4 18
3790
0
thg 3 15
3596
0
thg 7 25
294
0
thg 4 25
768