Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
6398 Переглядів
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
20403
1
жовт. 20
4813
change search filter Вирішено
2
лист. 16
4177
4
бер. 15
21116