Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6383 Lượt xem
For example, there are two models:
sale.order and purchase.order
Where we can select a product from the filtered list  of products using one of your favorite filter by pressing on "Search more..."
How to set one filter for the first model, and another for the second model, if they standard for both?
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Gleb,

You can do it by passing the default search filter in the context of the o2m field in XML file by inheriting the view of related object.

Ex:

<xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="attributes">
    <attribute name="context">{'search_default_ur_filter_name': 1}</attribute> # Here you need to add the original context from the base view as well
</attributes>


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

Thanks for the answer

I understand how to do it through the widget)

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 23
3060
7
thg 4 21
20390
1
thg 10 20
4807
2
thg 11 16
4175
4
thg 3 15
21109