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:
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”
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.
I tried the following:
Go to Settings → Technical → Actions → Window Actions
Find the action with Action Name ‘Suppliers’
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)
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!
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?
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