Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2186 Zobrazení

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šit
Nejlepší odpověď

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šit
Related Posts Odpovědi Zobrazení Aktivita
2
říj 22
4929
1
čvn 25
1674
3
čvc 25
3303
1
kvě 25
1441
1
kvě 25
1701