Skip to Content
Menú
This question has been flagged
1 Respondre
1957 Vistes

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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
2
d’oct. 22
4666
1
de juny 25
1054
3
de jul. 25
2792
1
de maig 25
1014
1
de maig 25
1253