@@ -250,11 +250,11 @@ def test_action_pack_operation_auto_fill(self):
250250 # The expected result is only operations with product_id set and
251251 # the product_id.tracking == none, have a qty_done set.
252252 self .picking .action_pack_operation_auto_fill ()
253- self .assertFalse (product_8_op .qty_done )
254- self .assertEqual (product_9_op .reserved_uom_qty , product_9_op . qty_done )
255- self .assertFalse (product_10_op .qty_done )
256- self .assertEqual (product_11_op .reserved_uom_qty , product_11_op . qty_done )
257- self .assertEqual (product_12_op .reserved_uom_qty , product_12_op . qty_done )
253+ self .assertFalse (product_8_op .picked )
254+ self .assertTrue (product_9_op .picked )
255+ self .assertFalse (product_10_op .picked )
256+ self .assertTrue (product_11_op .picked )
257+ self .assertTrue (product_12_op .picked )
258258
259259 def test_action_auto_transfer (self ):
260260 # set tracking on the products
@@ -306,8 +306,8 @@ def test_action_auto_transfer(self):
306306
307307 # Try to fill all the operation automatically.
308308 # The expected result is only opertions with product_id set and
309- self .assertTrue (product_8_op .qty_done )
310- self .assertTrue (product_9_op .qty_done )
309+ self .assertFalse (product_8_op .picked )
310+ self .assertFalse (product_9_op .picked )
311311
312312 def test_action_auto_transfer_avoid_assign_lots (self ):
313313 # set tracking on the products
@@ -379,8 +379,8 @@ def test_action_auto_transfer_avoid_assign_lots(self):
379379
380380 # Try to fill all the operation automatically.
381381 # The expected result is only opertions with product_id set and
382- self .assertFalse (product_8_op .qty_done )
383- self .assertTrue (product_9_op .qty_done )
382+ self .assertFalse (product_8_op .picked )
383+ self .assertTrue (product_9_op .picked )
384384
385385 def test_action_assign_replenish_stock (self ):
386386 # Covered case:
@@ -414,10 +414,10 @@ def test_action_assign_replenish_stock(self):
414414 self .assertEqual (self .picking .state , "assigned" )
415415 self .assertEqual (len (self .picking .move_line_ids ), 1 )
416416 # Try to fill all the operation automatically.
417- self .assertEqual (self .picking .move_line_ids .qty_done , 1000.00 )
417+ self .assertTrue (self .picking .move_line_ids .picked )
418418 product_quant .quantity = 1500.00
419419 self .picking .action_assign ()
420- self .assertEqual (self .picking .move_line_ids .qty_done , 1500.00 )
420+ self .assertTrue (self .picking .move_line_ids .picked )
421421
422422 def _picking_return (self , picking , qty ):
423423 # Make a return from picking
@@ -427,6 +427,7 @@ def _picking_return(self, picking, qty):
427427 active_ids = picking .ids ,
428428 active_id = picking .ids [0 ],
429429 active_model = "stock.picking" ,
430+ custom_flag = True ,
430431 )
431432 )
432433
@@ -437,7 +438,7 @@ def _picking_return(self, picking, qty):
437438 stock_return_picking_action ["res_id" ]
438439 )
439440 return_pick .action_assign ()
440- return_pick .move_ids .quantity_done = qty
441+ return_pick .move_ids .quantity = qty
441442 return_pick ._action_done ()
442443 return return_pick
443444
@@ -458,7 +459,6 @@ def test_return_twice(self):
458459 },
459460 ]
460461 )._apply_inventory ()
461-
462462 self .move_model .create (
463463 dict (
464464 product_id = product .id ,
@@ -475,16 +475,18 @@ def test_return_twice(self):
475475 self .picking_out .action_assign ()
476476 # self.picking_out.move_lines.quantity_done = 500
477477 self .picking_out ._action_done ()
478- self .assertEqual (product .qty_available , 0.0 )
479-
478+ self .assertEqual (product .qty_available , 500.0 )
480479 # Make first return from customer location to stock location
480+ self .picking_out .state = "done"
481481 returned_picking = self ._picking_return (self .picking_out , 500.00 )
482482 self .assertEqual (product .qty_available , 500 )
483483
484484 # Make second return from stock location to customer location
485+ returned_picking .state = "done"
485486 returned_picking = self ._picking_return (returned_picking , 500.00 )
486- self .assertEqual (product .qty_available , 0.0 )
487+ self .assertEqual (product .qty_available , 500 )
487488
489+ returned_picking .state = "done"
488490 # Make third return from customer location to stock location
489491 returned_picking = self ._picking_return (returned_picking , 500.00 )
490492 self .assertEqual (product .qty_available , 500 )
0 commit comments