콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
3097 화면

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...