Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
2104 Prikazi

I can not able to sort country_states in alphabectically A-Z sorting, I have tried lambda python sorting, but I cannot overwrite its default sorting which is by state code.

I can able to sort countries name by python lambda sorting . Here is the code of country_states selection. Please kindly help.

Avatar
Opusti
Best Answer

Inherit res.country.state model and change change the order attribute like this

class CountryState(models.Model):    
    _inherit = 'res.country.state'
    _order = 'name asc, code asc'
Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
okt. 22
4852
1
jun. 25
1483
3
jul. 25
3180
1
maj 25
1315
1
maj 25
1578