I add a new field using selection that consist list of country. How to filter the country in list view (using search field in top right of the screen)? Or how to add a search like "Search 'my_filter' for : " in the search bar like the image below?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
A good way to accomplish this is to modify that particular view, specifically the search view section. If it doesn't have one you can add it. Here is good instruction for this: link text
Also see this about the filter tag as another possible solution: link text
<filter string="Current" domain="[('state','in',('open','draft'))]" help="Draft, Open and Pending Tasks" icon="terp-project"/>
<field name="project_id" select="1" widget="selection">
<filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-project"/>
</field>
The most simple method would be to create an advanced search including that custom field and save it.
Thanks for your answer, but can you help me to give a detailed step how to put that code or how to do it with developers mode in OpenERP? Because the documentation is not clear and I don't understand.
with OpenERP in Developer Mode browse to the place where you want to change the view. Find the drop-down on the upper left and select Edit Search View. An Edit SearchView dialog will open with form fields for editing the name, type etc. as well as the code for the view. For examples of how to code this open the file addons\stock\stock_view.xml and find the record tag with ID = view_picking_internal_search. Now go into the Warehouse/Incoming Shipments section of the app and click on search. The code for the search items you see is in that view file. Should help you understand how it works.
thank you for your answer..It's working..GBU
Hi, You find a solution?
Activate the Developer Mode
Go to the view you want to add the filter to
From the debug dropdown menu, select Manage Filters, and click Create
Give the filter a name and select the correct model (in your case Project Issue?)
Clear the User field so that everyone can access the filter
In the Domain section you put the filter condition itself, for example [('region','=','Africa')]
Save and go back to the tree view, and your filter should show up in the Custom Filters section of the search box
Hope that helps
Thanks for helping and giving answer. But it seems not working properly. I editing [('region','=','Africa')] into [('x_region','=','Africa')] (my field name) but it always get all of the issue. But if the code works, it still not a simple way to do with filter, isn't it? Because I have 7 selection of region, and if the user want to select 1 filter, he/she must have a 'anothor step to do' to pick the dropdown list in the search view. But again, thanks for your answer.
To search customers by phone or by mobile:
1. Activate the Developer Mode
2. Go to sales, customers
3. From the debug dropdown menu, select Edit SearchView
To search by phone add:
<field name="phone" filter_domain="['|','|',('display_name','ilike',self),('ref','=',self),('phone','ilike',self)]"/>
To search by mobile add:
<field name="mobile" filter_domain="['|','|',('display_name','ilike',self),('ref','=',self),('mobile','ilike',self)]"/>