Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
2087 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Okt. 22
4835
1
Juni 25
1448
3
Juli 25
3144
1
Mai 25
1276
1
Mai 25
1554