Skip to Content
Menu
This question has been flagged
2 Replies
2843 Views

   Hello Community,

Happy to make my first post! Hope I will find the answer to my question here.

1st I will explain what I mean by autocomplete: When you search somewhere (for instance Contacts app) to receive a list of contacts matching the entered text so far. 


I would like to achieve two things:

  • Autocomplete on name: For instance in the Contacts app there is suggestions only for Sales Persons and Related Company, but I want to able to search for Contact Name. I would like to port that feature in other search fields for instance in products.

  • For the Many2One fields when you get autocomplete results they are collapsed. For instance in Related company menu in order to see the results you have to expand it. This is very irritating as you have to do it after each letter you have typed. Is there a way to auto extend?

Thanks a lot!

Avatar
Discard
Best Answer

Hi Dimitar,

For the first case you can redefine the search view for the Contacts. You can search the record named "view_res_partner_filter" and add a line of code like this

<group expand="0" name="group_by" string="Group By">
<filter name="salesperson" string="Salesperson" domain="[]" context="{'group_by' : 'user_id'}" />
<filter name="contact_name" string="contact name" domain="[]" context="{'group_by' : 'display_name'}" />
<filter string="Company" context="{'group_by': 'parent_id'}"/>
<filter string="Country" context="{'group_by': 'country_id'}"/>
</group>


If you are going to do it as custom module, You can redefine the record by giving the record id as module_name.original_id

else you can add the line(bold one) into the original code. the file is in addons -> base -> res -> res_partner_view.xml .


And regarding the second point, i didn't  understand what exactly you are looking for .

Thanks

Avatar
Discard
Author Best Answer

Hi Niyas,

Thanks for your anwser I will try to implement it now.
For the second points, please see the screenshot below. Look below the searchbar how the suggestions  for Customer, Salesperson , etc. are collapsed and you have to click the arrow to see them.

http://www.odooclass.com/web/image/2042


Thanks,
Dimitar

Avatar
Discard