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

Hello

I think that I saw one day a syntax like :

<field name="partner_id" search="[('name','like','company')] />

So today I need to use this feature, help me please

Thank you.

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

So you can set the partner_id of an object to the existing partner with XML-ID base.res_partner_23:

<field name="partner_id" eval="ref('base.res_partner_23')"/>

If you want to perform a search, then you can use this style:

<field name="menu_id" model="ir.ui.menu" search="[('name', '=', 'Waiting Delivery Orders')]"/>
Ảnh đại diện
Huỷ bỏ
Tác giả

I have not explained well my problem, when we want to search in the model account.account we don't have the XML structure, because it generated in the system.

just updated my answer. Just saw that Mike has already posted the answer :)

Tác giả

Excatly is that what I look for, the search feature, the first one is static and I need some dynamic, Thank you

Câu trả lời hay nhất

You are essentially correct, but you should also include the model name: for example:

<field name="partner_id" model="res.partner" search="[('name','like',u'Mike%')]"/>
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
8
thg 7 24
16274
0
thg 4 16
3827
2
thg 3 15
5683
0
thg 3 15
4815
0
thg 3 15
8372