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

Hi!

I'm facing a little issue trying to filter some records from a custom model (product.new) using a domain.

product_ids = fields.Many2one('product.new', "New product", required=True, domain=[('state','=','stock')])

This field (product_ids) is displayed in a custom wizard (transient model). The purpose is, when i click the drop down many2one field, i want to see the products which are in "stock" state, but I'm seeing every product without discriminate the state. Here is the call performed on name_search


The funny thing is, when i click on "Search more" on my drop down many2one field, the list of products are filtered by state=stock! And here is performing a search_read:



How can I fix that?

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

EDIT: I found the issue; it was related to a custom model which modifies the name_search behaviour, without using the parameter "args" (this one provides the domain)

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 22
970
0
thg 5 20
3191
3
thg 1 23
6183
2
thg 1 23
951
1
thg 10 22
3895