@@ -17,38 +17,41 @@ def setUpClass(cls):
17
17
category_all_id = cls .env .ref ("product.product_category_all" ).id
18
18
cls .product_obj = cls .env ["product.product" ]
19
19
cls .stock_rule_obj = cls .env ["stock.rule" ]
20
+ # The model stock doesn't add anymore the 'product'
21
+ # selection to the product type.
22
+ # Thus the type is changed to 'consu'
20
23
component_1 = cls .product_obj .create (
21
24
{
22
25
"name" : "Component 1" ,
23
- "detailed_type " : "product " ,
26
+ "type " : "consu " ,
24
27
"categ_id" : category_all_id ,
25
28
}
26
29
)
27
30
component_2 = cls .product_obj .create (
28
31
{
29
32
"name" : "Component 2" ,
30
- "detailed_type " : "product " ,
33
+ "type " : "consu " ,
31
34
"categ_id" : category_all_id ,
32
35
}
33
36
)
34
37
component_3 = cls .product_obj .create (
35
38
{
36
39
"name" : "Component 3" ,
37
- "detailed_type " : "service" ,
40
+ "type " : "service" ,
38
41
"categ_id" : category_all_id ,
39
42
}
40
43
)
41
44
component_4 = cls .product_obj .create (
42
45
{
43
46
"name" : "Component 4" ,
44
- "detailed_type " : "consu" ,
47
+ "type " : "consu" ,
45
48
"categ_id" : category_all_id ,
46
49
}
47
50
)
48
51
cls .pack_dc = cls .product_obj .create (
49
52
{
50
53
"name" : "Pack" ,
51
- "detailed_type " : "product " ,
54
+ "type " : "consu " ,
52
55
"pack_ok" : True ,
53
56
"pack_type" : "detailed" ,
54
57
"pack_component_price" : "detailed" ,
@@ -94,7 +97,7 @@ def setUpClass(cls):
94
97
cls .pack_dc_with_dm = cls .product_obj .create (
95
98
{
96
99
"name" : "Pack With storeable and not move product" ,
97
- "detailed_type " : "product " ,
100
+ "type " : "consu " ,
98
101
"pack_ok" : True ,
99
102
"dont_create_move" : True ,
100
103
"pack_type" : "detailed" ,
@@ -161,6 +164,18 @@ def test_compute_quantities_dict(self):
161
164
"location_dest_id" : location_dest_id ,
162
165
},
163
166
),
167
+ (
168
+ 0 ,
169
+ 0 ,
170
+ {
171
+ "name" : "incoming_move_test_03" ,
172
+ "product_id" : components [3 ].id ,
173
+ "product_uom_qty" : 9 ,
174
+ "product_uom" : components [3 ].uom_id .id ,
175
+ "location_id" : location_id ,
176
+ "location_dest_id" : location_dest_id ,
177
+ },
178
+ ),
164
179
],
165
180
}
166
181
)
@@ -175,8 +190,8 @@ def test_compute_quantities_dict(self):
175
190
)
176
191
).save ()
177
192
wizard .process ()
178
- self .assertEqual (self .pack_dc .virtual_available , 5 )
179
- self .assertEqual (self .pack_dc .qty_available , 5 )
193
+ self .assertEqual (self .pack_dc .virtual_available , 0 )
194
+ self .assertEqual (self .pack_dc .qty_available , 0 )
180
195
181
196
def test_pack_with_dont_move_the_parent (self ):
182
197
"""Run a procurement for prod pack products when there are only 5 in stock then
@@ -186,7 +201,7 @@ def test_pack_with_dont_move_the_parent(self):
186
201
def create_orderpoint (product , qty_min , qty_max , location , group ):
187
202
return self .env ["stock.warehouse.orderpoint" ].create (
188
203
{
189
- "name" : "OP/%s" % product .name ,
204
+ "name" : f "OP{ product .name } " ,
190
205
"product_id" : product .id ,
191
206
"product_min_qty" : qty_min ,
192
207
"product_max_qty" : qty_max ,
@@ -203,7 +218,7 @@ def create_orderpoint(product, qty_min, qty_max, location, group):
203
218
self .env .ref ("stock.stock_location_stock" ),
204
219
pg ,
205
220
)
206
- self .env ["stock.scheduler.compute" ].create ({}).procure_calculation ()
221
+ # self.env["stock.scheduler.compute"].create({}).procure_calculation()
207
222
picking_ids = self .env ["stock.picking" ].search ([("group_id" , "=" , pg .id )])
208
223
# we need to ensure that only the compents of the packs are in the moves.
209
224
self .assertFalse (self .pack_dc_with_dm in picking_ids .move_ids .product_id )
0 commit comments