Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
6403 Представления
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?
Аватар
Отменить
Лучший ответ

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>


Аватар
Отменить
Автор

Thanks for the answer

I understand how to do it through the widget)

Related Posts Ответы Просмотры Активность
2
нояб. 23
3067
7
апр. 21
20410
1
окт. 20
4813
2
нояб. 16
4180
4
мар. 15
21116