@@ -58,10 +58,11 @@ def create_stock_move(self, picking, product, price=0.0):
5858 move .write ({"price_unit" : price })
5959 return move
6060
61- def create_stock_move_line (self , move , lot_name = False ):
61+ def create_stock_move_line (self , move , picking , lot_name = False ):
6262 move_line = self .env ["stock.move.line" ].create (
6363 {
6464 "move_id" : move .id ,
65+ "picking_id" : picking .id ,
6566 "product_id" : move .product_id .id ,
6667 "location_id" : move .location_id .id ,
6768 "location_dest_id" : move .location_dest_id .id ,
@@ -77,7 +78,7 @@ def test_stock_valuation_fifo_lot(self):
7778 self .supplier_location , self .stock_location , self .picking_type_in
7879 )
7980 move = self .create_stock_move (receipt_picking_1 , self .product , 100 )
80- self .create_stock_move_line (move , "11111" )
81+ self .create_stock_move_line (move , receipt_picking_1 , "11111" )
8182
8283 receipt_picking_1 .action_confirm ()
8384 receipt_picking_1 .action_assign ()
@@ -88,7 +89,7 @@ def test_stock_valuation_fifo_lot(self):
8889 self .supplier_location , self .stock_location , self .picking_type_in
8990 )
9091 move = self .create_stock_move (receipt_picking_2 , self .product , 200 )
91- self .create_stock_move_line (move , "22222" )
92+ self .create_stock_move_line (move , receipt_picking_2 , "22222" )
9293
9394 receipt_picking_2 .action_confirm ()
9495 receipt_picking_2 .action_assign ()
@@ -100,7 +101,7 @@ def test_stock_valuation_fifo_lot(self):
100101 self .stock_location , self .customer_location , self .picking_type_out
101102 )
102103 move = self .create_stock_move (delivery_picking1 , self .product )
103- move_line = self .create_stock_move_line (move )
104+ move_line = self .create_stock_move_line (move , delivery_picking1 )
104105 lot_id = self .env ["stock.lot" ].search (
105106 [("name" , "=" , "22222" ), ("product_id" , "=" , self .product .id )]
106107 )
@@ -116,7 +117,7 @@ def test_stock_valuation_fifo_lot(self):
116117 self .supplier_location , self .stock_location , self .picking_type_in
117118 )
118119 move = self .create_stock_move (receipt_picking_3 , self .product , 300 )
119- self .create_stock_move_line (move , "33333" )
120+ self .create_stock_move_line (move , receipt_picking_3 , "33333" )
120121
121122 receipt_picking_3 .action_confirm ()
122123 receipt_picking_3 .action_assign ()
0 commit comments