[FIX] purchase: Wrong scheduled date for backorder
Fine tuning of this commit:7333f5e When the PO lines were not ordered according to the scheduled date, the scheduled date of the picking was wrong when delivering. opw:752192
This commit is contained in:
@@ -358,7 +358,7 @@ class PurchaseOrder(models.Model):
|
||||
moves = order.order_line.filtered(lambda r: r.product_id.type in ['product', 'consu'])._create_stock_moves(picking)
|
||||
move_ids = moves.action_confirm()
|
||||
seq = 0
|
||||
for move in moves:
|
||||
for move in sorted(moves, key=lambda move: move.date_expected):
|
||||
seq += 5
|
||||
move.sequence = seq
|
||||
moves = self.env['stock.move'].browse(move_ids)
|
||||
|
||||
Reference in New Issue
Block a user