تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
7786 أدوات العرض

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
يوليو 24
8297
2
مايو 23
2013
0
أبريل 17
3057
1
أبريل 17
4438
2
نوفمبر 15
4805