Odoo Help


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.


how can i assgin two different filters two same model but with different menu ?

Ahmed elbarbary
on 2/4/15, 4:21 AM 583 views

how to assign two different filters to same model ? such as products model in sales module (sales--->products) there is defined filter (can be sold ) and in purchase-->products there is defined filter can be purchase , now in warehouse --> products i need to define default filter but the problem is when i assign it it apply to all product views in sales and in purchase but i need it in warehouse only , how can i do that ? and how is it applied different filter to purchase and sales products ?

Thanks in advance


Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
Tiny ERP Pvt Ltd
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.


Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 


We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :


  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 2/4/15, 4:43 AM

This can be done using the "window action". You can set the value of "context" under the action and achieve this.

Try to find the "action" for that menu and try to define your filter under the "context" attribute.

See the example

Product under Sales menu,

context = {"search_default_filter_to_sell":1} ---> this leads to default selection of "sellable" product filter.

context={"search_default_filter_to_purchase":1} ---> this leads to default selection of "purchase" product filter.

So here in the search view there is a filter already defined as "filter_to_sell" and "filter_to_purchase" and using this in the context value for different actions, appropriate filters are set as default selection during load of the list view.

For your reference in the product module search for "product_normal_action_sell" this action, you will get the idea.

So same way you need to define your filter and use the context attribute of the action.

Hope this helps !!.

thank you very much it is working, can i ask you another question ? is there away to assign defaults to fields when create product from warehouse menu which is different from defaults when create from sales menu ?

Ahmed elbarbary
on 2/4/15, 4:54 AM

thanks @ emipro technologies pvt ltd. this code fully work

Ankit H Gandhi(AHG)
on 2/4/15, 4:55 AM

Yes @elbarbary... it is possible to set default values for different action. You can do this by using {"default_field_name":>} in the context attribute. Try to look different actions, which are already there in the system, that will help you more.

Emipro Technologies Pvt. Ltd.
on 2/4/15, 5:23 AM

@ Emipro Technologies Pvt. Ltd. it is working fine thanks again for your help , i appreciate that

Ahmed elbarbary
on 2/4/15, 5:35 AM

@elbarbary ... You'r welcome...

Emipro Technologies Pvt. Ltd.
on 2/5/15, 8:26 AM

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

1 follower(s)


Asked: 2/4/15, 4:21 AM
Seen: 583 times
Last updated: 3/16/15, 8:10 AM