İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
2616 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Eki 22
5801
2
Eki 25
2771
1
Eyl 25
2777
3
Tem 25
4148
1
May 25
2242