From dc7c4ef52adafa5e724dad212bfd37730c3c1015 Mon Sep 17 00:00:00 2001 From: Arnaud Baes Date: Fri, 29 Mar 2019 14:46:52 +0000 Subject: [PATCH] [FIX] stock: move_ids_without_package locations Since the package level task, most time it is not move_lines which is displayed in the form view but move_ids_without_package. We apply the weird write override to this field too, and we'll apply the comment in the code (change this override by a proper onchange) someday in the future. Task 1831382 --- addons/stock/models/stock_picking.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index b5245e34dcd..275a0cd4e35 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -494,8 +494,9 @@ class Picking(models.Model): # TDE FIXME: what ? # As the on_change in one2many list is WIP, we will overwrite the locations on the stock moves here # As it is a create the format will be a list of (0, 0, dict) - if vals.get('move_lines') and vals.get('location_id') and vals.get('location_dest_id'): - for move in vals['move_lines']: + moves = vals.get('move_lines') or vals.get('move_ids_without_package') + if moves and vals.get('location_id') and vals.get('location_dest_id'): + for move in moves: if len(move) == 3 and move[0] == 0: move[2]['location_id'] = vals['location_id'] move[2]['location_dest_id'] = vals['location_dest_id']