Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
6501 Zobrazení
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?
Avatar
Zrušit
Nejlepší odpověď

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>


Avatar
Zrušit
Autor

Thanks for the answer

I understand how to do it through the widget)

Related Posts Odpovědi Zobrazení Aktivita
2
lis 23
3243
7
dub 21
20675
1
říj 20
5003
2
lis 16
4326
4
bře 15
21223