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

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
4857
1
июн. 25
1503
3
июл. 25
3195
1
мая 25
1332
1
мая 25
1588