Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
1897 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
okt. 22
4550
1
jun. 25
870
3
maj 25
2600
1
maj 25
837
1
maj 25
1023