From 17c542b9021d189d8337d47367d5d25c4e6651cb Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Tue, 28 Jan 2020 09:04:08 +0000 Subject: [PATCH] [FIX] stock: _search_picking_for_assignation and immediate transfer When a move is created through a push rule, the system will first try to find a picking to put it into before creating a new one. It is possible the move is placed into an immediate picking where the reservation fields are hidden and the initial demand is updated according to the qty_done with [0]. As this behaviour is unwanted, do not merge move into immediate transfers (which should be short-lived anyway). [0] 8303b1a69e96807bcb548ef079dcb463e34df36b closes odoo/odoo#44086 X-original-commit: fa9efd28e6e113cd9993a29bca070ddee83630c0 Signed-off-by: Arnold Moyaux --- addons/stock/models/stock_move.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 165e750251f..e3b1a140aff 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -864,6 +864,7 @@ class StockMove(models.Model): ('location_dest_id', '=', self.location_dest_id.id), ('picking_type_id', '=', self.picking_type_id.id), ('printed', '=', False), + ('immediate_transfer', '=', False), ('state', 'in', ['draft', 'confirmed', 'waiting', 'partially_available', 'assigned'])], limit=1) return picking