Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2006 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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'
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
paź 22
4727
1
cze 25
1169
3
lip 25
2902
1
maj 25
1083
1
maj 25
1363