From 08316eb4557534d1aaf551e3b520aeca5ceb4c0a Mon Sep 17 00:00:00 2001 From: amoyaux Date: Wed, 20 Sep 2017 13:36:26 +0200 Subject: [PATCH] [FIX] stock: complete/push move without initial demand It exists a different behavior when moves do not have an initial demand. It will not set the initial demand to the quantity processed once the move is done. It will also not propagate the extra quantities to next moves. This commit modify _create_extra_move method in order to use the same behavior than other usecases. It will create a move without quantity done and without initial demand (which do not make sense) but this move will be merged in the new one and will not be visible for the user. --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index f248e727b86..ca7b081acaa 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -906,7 +906,7 @@ class StockMove(models.Model): extra_move = self.env['stock.move'] rounding = self.product_uom.rounding # moves created after the picking is assigned do not have `product_uom_qty`, but we shouldn't create extra moves for them - if self.product_uom_qty and float_compare(self.quantity_done, self.product_uom_qty, precision_rounding=rounding) > 0: + if float_compare(self.quantity_done, self.product_uom_qty, precision_rounding=rounding) > 0: # create the extra moves extra_move_quantity = float_round( self.quantity_done - self.product_uom_qty,