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

I was wondering if there is a way to set the order_by for a specific tree view in the xml code.  Is there a way to do this?

아바타
취소
베스트 답변

There is a default_order attribute

https://www.odoo.com/documentation/8.0/reference/views.html#lists

아바타
취소
베스트 답변

You can do this in your module's action code (or inherit an already existing action). 

Set it in the context with 'order'.  To order it by the Status field for instance (which is 'state' in the database):

 <record id="action_unique_identifier" model="ir.actions.act_window">
             <!-- a bunch of fields -->
            <field name="context">{'order': 'state'}</field>

 

아바타
취소
관련 게시물 답글 화면 활동
2
5월 18
4236
6
9월 17
8301
0
6월 15
3879
3
6월 15
8026
1
3월 15
4489