Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1714 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
ott 22
4322
1
giu 25
608
3
mag 25
2355
1
mag 25
593
1
mag 25
763