How to get alphabatically sorted records on Search View?

370 Views Asked by At

I have created a many2many field containing tags . It shows Search More .. option in the dropdown , when I click Search More button the pop displays records . I want these records alphabetically sorted . How can I do that ?

2

There are 2 best solutions below

0
Omi Harjani On

Could you try adding the following in your py file.

    _order= "id asc"
0
KbiR On

In many2many model use `_order = "name asc".

Example:

_name='res.partner'
_order='name asc'

Hope it will help you.