This question has been flagged
1 Reply
18206 Views

Currently, Sales->Sales->Sales Orders is filter free, and shows all users all the Sales Orders in all states.

I would like this to come up with a default search of "Sales" (which is an easily selected option from the dropdown menu of the Search bar). However, I want it to be easily cleared in the event that a "done" or "canceled" sales order needs to be found.

I can configure the default filter in "Domain Value" under Settings->Technical->User Interface->Window Actions, but when the filter is configured here, the normal user cannot clear it.

I'm sure this is something simple, I've just not found the right place to configure it, or my lack of knowledge of Python is preventing me from implementing it.

Any assistance is appreciated. Jason

Avatar
Discard
Best Answer

You can set default filters in the context of the window action.

Just write:

{"search_default_<value>":1}

to set filter <value> as default. For the sales order the following pre-defined filters are available (use it instead of <value>):

  • name
  • type_person
  • type_company
  • customer
  • supplier

Or you can create a new filter in the SearchView. Instead of changing window actions and views in the Settings menu you can also activate the Developer Mode - see here

Avatar
Discard
Author

Andreas - Thank you for your help, I was able to get the Sales Order to configure they way I wanted by adding {"search_default_sales":1} in the Window Action. However, when I tried to do this same exact thing in the Sales->Sales->Quotations window {"search_default_quotations":1}, the search doesn't show up in the Search bar. Any reason why the two windows behave differently?

Author

I figured it out. Even though the "filter" name is "Quotations" the default search criteria is "draft"; so putting the context of {"search_default_draft":1} resulted in the desired behavior. Thanks again for pointing me in the right direction.