Skip to Content
Menu
This question has been flagged
3678 Zobrazenia

I have a field that is placed on the header of my form with this definition: <field name="current_stage" widget="statusbar" domain="[('stage_ok','=',True)]"/>

My problem is, the field is of many2one type and displayed in alphabetical order. How can I sort it to display with the lowest ID first.

Tnx.

Avatar
Zrušiť

Hello Sir,

did you try this code?

records.sorted(key=lambda r: r.name)