コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2049 ビュー

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'
アバター
破棄
関連投稿 返信 ビュー 活動
2
10月 22
4793
1
6月 25
1261
3
7月 25
3032
1
5月 25
1172
1
5月 25
1450