@@ -13,8 +13,9 @@ def setUpClass(cls):
13
13
cls .product_test = cls .env ["product.product" ].create (
14
14
{
15
15
"name" : "Product TEST" ,
16
- "type" : "product " ,
16
+ "type" : "consu " ,
17
17
"weight" : 0.1 ,
18
+ "is_storable" : True ,
18
19
"uom_id" : cls .uom_kg .id ,
19
20
"uom_po_id" : cls .uom_kg .id ,
20
21
}
@@ -65,7 +66,7 @@ def test_put_in_pack_choose_carrier_wizard(self):
65
66
"product_id" : self .product_test .id ,
66
67
"product_uom_id" : self .uom_kg .id ,
67
68
"picking_id" : picking_ship .id ,
68
- "qty_done " : 5 ,
69
+ "quantity " : 5 ,
69
70
"location_id" : self .stock_location .id ,
70
71
"location_dest_id" : self .customer_location .id ,
71
72
}
@@ -76,7 +77,7 @@ def test_put_in_pack_choose_carrier_wizard(self):
76
77
# We make sure the correct action was returned
77
78
self .assertEqual (pack_action_model , "choose.delivery.package" )
78
79
# check there is no package yet for the picking
79
- self .assertEqual (len (picking_ship .package_ids ), 0 )
80
+ self .assertEqual (len (picking_ship .package_level_ids ), 0 )
80
81
# We instanciate the wizard with the context of the action
81
82
pack_wiz = (
82
83
self .env ["choose.delivery.package" ]
@@ -91,21 +92,23 @@ def test_put_in_pack_choose_carrier_wizard(self):
91
92
)
92
93
pack_wiz .action_put_in_pack ()
93
94
# check that one package has been created with the same number of packages
94
- self .assertEqual (len (picking_ship .package_ids ), 1 )
95
- package1 = picking_ship .package_ids [0 ]
95
+ self .assertEqual (len (picking_ship .package_level_ids ), 1 )
96
+ package1 = picking_ship .package_level_ids [0 ]
96
97
# check the related number_of_parcels is ok in the package
97
98
self .assertEqual (
98
- package1 .number_of_parcels , self .package_type .number_of_parcels
99
+ package1 .package_id . number_of_parcels , self .package_type .number_of_parcels
99
100
)
100
101
return package1
101
102
102
103
def test_manual_number_of_parcels (self ):
103
104
package = self .test_put_in_pack_choose_carrier_wizard ()
104
- self .assertEqual (package .number_of_parcels , 7 )
105
+ self .assertEqual (package .package_id . number_of_parcels , 7 )
105
106
self .package_type .number_of_parcels = 8
106
- self .assertEqual (package .number_of_parcels , 7 )
107
- package .number_of_parcels = 9
108
- self .assertEqual (package .number_of_parcels , 9 )
107
+ self .assertEqual (package .package_id . number_of_parcels , 7 )
108
+ package .package_id . number_of_parcels = 9
109
+ self .assertEqual (package .package_id . number_of_parcels , 9 )
109
110
self .assertEqual (self .package_type .number_of_parcels , 8 )
110
- package .package_type_id = self .package_type .copy ({"number_of_parcels" : 10 })
111
- self .assertEqual (package .number_of_parcels , 10 )
111
+ package .package_id .package_type_id = self .package_type .copy (
112
+ {"number_of_parcels" : 10 }
113
+ )
114
+ self .assertEqual (package .package_id .number_of_parcels , 10 )
0 commit comments