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

Our warehouse picks from the Delivery order, in order to make their lives a whole lot easier the product listings should be in a consistent order. What is the best way to sort a delivery order move_line list. The intent is to sort according to code. I attempted to add a python sorted() in the repeatIn but it seems it's not available. Any other ideas?

아바타
취소
베스트 답변

Create a custom module or use an existing one and include the following code:

class stock_move( osv.osv ):
    _inherit = "stock.move"
    _order = 'field_name'

stock_move()

field_name : the field you want to sort the lines by.

Note: You can use _order = 'field_name desc' if you want to change the sort direction.

아바타
취소
작성자

default_code is not stored within the stock.move object how do I pull that data in so I can sort with it?

작성자

Solved my own issue. Setting the stock.move.name to the SKU allows me to sort using it without messing up anything

베스트 답변

Using the _order='name' on the inherited class of product.product solved my problem. It seems by default products are sorted by internal reference code so maybe that might have been the issue

아바타
취소
관련 게시물 답글 화면 활동
3
7월 24
9178
2
5월 23
2514
0
4월 17
3704
1
4월 17
4992
2
11월 15
5458