Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How do I configure a default search criteria?

By
Jason
on 3/7/13, 6:17 PM 4,841 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

1

Andreas Brueckl

--Andreas Brueckl--
5056
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 3/7/13, 6:29 PM

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

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?

Jason
on 3/7/13, 7:09 PM

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.

Jason
on 3/7/13, 7:36 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 3/7/13, 6:17 PM
Seen: 4841 times
Last updated: 3/16/15, 8:10 AM