Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1829 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
oct 22
4392
1
jun 25
691
3
may 25
2438
1
may 25
676
1
may 25
851