Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Sorting move_lines by Code in delivery order

By
Nicholas Linn
on 10/11/13, 12:40 PM 992 views

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?

1

IBS

--IBS--
1302
| 4 5 8
Tétouan, Morocco
--IBS--

For more informations about IBS, please visit our website at www.ibs-na.com.

For a specific questions, collaboration or help, please send us an email to support@ibs-na.com

IBS
On 10/12/13, 8:32 AM

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?

Nicholas Linn
on 10/15/13, 11:42 AM

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

Nicholas Linn
on 10/15/13, 4:10 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 10/11/13, 12:40 PM
Seen: 992 times
Last updated: 3/16/15, 8:10 AM