@@ -11,7 +11,7 @@ class TestStockPickingDeliveryLink(StockPickingDeliveryLinkCommonCase):
11
11
def setUpClass (cls ):
12
12
super ().setUpClass ()
13
13
cls .product = cls .env ["product.product" ].create (
14
- {"name" : "Test Product" , "type" : "product" }
14
+ {"name" : "Test Product" , "type" : "consu" , "is_storable" : True }
15
15
)
16
16
cls .customer_location = cls .env .ref ("stock.stock_location_customers" )
17
17
test_carrier_product = cls .env ["product.product" ].create (
@@ -159,9 +159,11 @@ def test_put_in_pack_from_pick_with_wizard(self):
159
159
# force wizard on pick operation picking_type_id
160
160
pick_picking .picking_type_id .set_delivery_package_type_on_put_in_pack = True
161
161
pick_picking .action_assign ()
162
- pick_picking .move_line_ids .filtered (
162
+ pick_line = pick_picking .move_line_ids .filtered (
163
163
lambda ml : ml .product_id == self .product
164
- ).qty_done = 5.0
164
+ )
165
+ self .assertEqual (pick_line .quantity , 5 )
166
+ pick_line .picked = True
165
167
pip_action = pick_picking .action_put_in_pack ()
166
168
# check the action is a dict
167
169
self .assertIsInstance (pip_action , dict )
@@ -215,9 +217,11 @@ def test_put_in_pack_from_pick_with_wizard_carrier(self):
215
217
# force wizard on pick operation picking_type_id
216
218
pick_picking .picking_type_id .set_delivery_package_type_on_put_in_pack = True
217
219
pick_picking .action_assign ()
218
- pick_picking .move_line_ids .filtered (
220
+ pick_line = pick_picking .move_line_ids .filtered (
219
221
lambda ml : ml .product_id == self .product
220
- ).qty_done = 5.0
222
+ )
223
+ self .assertEqual (pick_line .quantity , 5 )
224
+ pick_line .picked = True
221
225
pip_action = pick_picking .action_put_in_pack ()
222
226
# check the action is a dict
223
227
self .assertIsInstance (pip_action , dict )
@@ -268,9 +272,11 @@ def test_put_in_pack_from_pick_without_wizard(self):
268
272
# set a carrier on shipment picking but do not force wizard on picking type
269
273
ship_picking .carrier_id = self .test_carrier
270
274
pick_picking .action_assign ()
271
- pick_picking .move_line_ids .filtered (
275
+ pick_line = pick_picking .move_line_ids .filtered (
272
276
lambda ml : ml .product_id == self .product
273
- ).qty_done = 5.0
277
+ )
278
+ self .assertEqual (pick_line .quantity , 5 )
279
+ pick_line .picked = True
274
280
pip_action = pick_picking .action_put_in_pack ()
275
281
# the action is not a dict so not a wizard
276
282
self .assertNotIsInstance (pip_action , dict )
0 commit comments