Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2333 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
2
oct. 22
5373
1
sept. 25
2234
1
juin 25
2259
3
juil. 25
3769
1
mai 25
1895