Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2332 Представления

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
5373
1
сент. 25
2234
1
июн. 25
2259
3
июл. 25
3769
1
мая 25
1895