Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2090 Переглядів

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.

Аватар
Відмінити
Найкраща відповідь

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'
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
жовт. 22
4838
1
черв. 25
1460
3
лип. 25
3157
1
трав. 25
1288
1
трав. 25
1562