This question has been flagged
1 Reply
17076 Views

Hi!

I am looking to personalize my Odoo. For this I started working on the Suppliers list available via Purchases --> Purchase --> Suppliers.

By default the view is shown in Kanban view, whereas I prefer List view. This was fixed in the following way:

  1. Go to Settings → Technical → Actions → Window Actions

  2. Find the action with Action Name ‘Suppliers’

  3. Under Views, edit the View Mode parameter from “kanban,tree,form” to “tree,kanban,form”

  4. Click Save

Next, by default the Supplier view lists both companies and persons. I would like to filter on companies only by default. Now I have to edit the search (click downward arrow in search box) and filter on Companies.

  1. I tried the following:

  2. Go to Settings → Technical → Actions → Window Actions

  3. Find the action with Action Name ‘Suppliers’

  4. Under Filters, I changed the Context Value to {'search_default_supplier': 1,'default_customer': 0,'default_supplier': 1,'search_default_is_company': 1} (I added the last item in the dict object; the first 3 were already there)

  5. Click Save

Unfortunately this does not work. Can someone point me in the right direction? Please note that I only have access to the web interface of Odoo. Thanks!

Avatar
Discard
Author

What (partially) works is the following: Go to Settings → Technical → Actions → Window Actions Find the action with Action Name ‘Suppliers’ Under Views, edit the View Mode parameter from “kanban,tree,form” to “tree,kanban,form” Under Filters, edit the Domain Value from “[]” to “[['is_company', '=', 1]]” Downside is that now all persons are no longer present in the underlying data. I guess that what I am asking is the following: if you go to the Suppliers View (Purchases → Purchase → Suppliers) and expand the search box by clicking on the down facing arrow, you are presented with a set of common filter criteria. Of those 'Suppliers' is enabled by default, whereas 'Companies' is not. Where are those filters defined? And where can I set defaults?

Author

Alright, my solution was to do the following: Via GitHub I found out that the view and filters are defined in: odoo/openerp/addons/base/res/res_partner_view.xml The important line here is: To enable this filter by default I added 'search_default_type_company': 1 to the Context Value

Best Answer

Hi when you go into the supplier view, you can see that 'Suppliers' are already selected as a filter. If you select the filter in that screen area you can see you can also select 'Companies'.

Now you want to both save that search and make it your default, you first need to select to save the filter, to do this you must give it a name (I used 'Supplier Companies'), now when you select to save the filter you also get an option to 'Use By Default' (as well as sharing the filter), if you set use by default, this filter will appear every time you go into that view as default.

Avatar
Discard