Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
1951 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
out. 22
4659
1
jun. 25
1050
3
jul. 25
2791
1
mai. 25
1013
1
mai. 25
1251