[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.
This commit is contained in:
amoyaux
2017-09-20 15:08:37 +02:00
parent 46cfc2e41d
commit 08316eb455
+1 -1
View File
@@ -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,