Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
6399 Ansichten
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
Verwerfen
Beste Antwort

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
Verwerfen
Autor

Thanks for the answer

I understand how to do it through the widget)

Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Nov. 23
3067
7
Apr. 21
20404
1
Okt. 20
4813
2
Nov. 16
4177
4
März 15
21116