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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 7 24
|
9074 | ||
|
2
thg 5 23
|
2486 | ||
|
0
thg 4 17
|
3672 | ||
|
1
thg 4 17
|
4944 | ||
|
2
thg 11 15
|
5390 |