Skip to Content
Menu
This question has been flagged
1 Odpoveď
2239 Zobrazenia

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
Zrušiť
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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
okt 22
5220
1
jún 25
1943
3
júl 25
3534
1
máj 25
1653
1
máj 25
1893