Hi guys, I am creating a form with field many2one as customer, how can i sort this field alphabetically?
Thanks!!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi guys, I am creating a form with field many2one as customer, how can i sort this field alphabetically?
Thanks!!
Hi,
Here is a forum answer that lets you sort in descending order. Please go through it.
https://www.odoo.com/forum/help-1/how-to-sort-a-many2one-field-in-descending-order-52793
Change the xml
<field name="period_id" context="{'order_display': 'name desc' }"/>
To
<field name="period_id" context="{'order_display': 'name asc ' }"/>
To sort in ascending order
Regards
Add, context="{'order_display': 'name asc ' }" or context="{'order_display': 'name desc ' }" in xml view fields
doesn't make sense to repeat the same answer without any thing extra
@Niyas Raphy..Just answered a query nothing much...
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up