@@ -17,38 +17,44 @@ 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" ,
27
+ "is_storable" : True ,
24
28
"categ_id" : category_all_id ,
25
29
}
26
30
)
27
31
component_2 = cls .product_obj .create (
28
32
{
29
33
"name" : "Component 2" ,
30
- "detailed_type" : "product" ,
34
+ "type" : "consu" ,
35
+ "is_storable" : True ,
31
36
"categ_id" : category_all_id ,
32
37
}
33
38
)
34
39
component_3 = cls .product_obj .create (
35
40
{
36
41
"name" : "Component 3" ,
37
- "detailed_type " : "service" ,
42
+ "type " : "service" ,
38
43
"categ_id" : category_all_id ,
39
44
}
40
45
)
41
46
component_4 = cls .product_obj .create (
42
47
{
43
48
"name" : "Component 4" ,
44
- "detailed_type" : "consu" ,
49
+ "type" : "consu" ,
50
+ "is_storable" : True ,
45
51
"categ_id" : category_all_id ,
46
52
}
47
53
)
48
54
cls .pack_dc = cls .product_obj .create (
49
55
{
50
56
"name" : "Pack" ,
51
- "detailed_type " : "product " ,
57
+ "type " : "consu " ,
52
58
"pack_ok" : True ,
53
59
"pack_type" : "detailed" ,
54
60
"pack_component_price" : "detailed" ,
@@ -94,7 +100,7 @@ def setUpClass(cls):
94
100
cls .pack_dc_with_dm = cls .product_obj .create (
95
101
{
96
102
"name" : "Pack With storeable and not move product" ,
97
- "detailed_type " : "product " ,
103
+ "type " : "consu " ,
98
104
"pack_ok" : True ,
99
105
"dont_create_move" : True ,
100
106
"pack_type" : "detailed" ,
@@ -161,6 +167,18 @@ def test_compute_quantities_dict(self):
161
167
"location_dest_id" : location_dest_id ,
162
168
},
163
169
),
170
+ (
171
+ 0 ,
172
+ 0 ,
173
+ {
174
+ "name" : "incoming_move_test_03" ,
175
+ "product_id" : components [3 ].id ,
176
+ "product_uom_qty" : 9 ,
177
+ "product_uom" : components [3 ].uom_id .id ,
178
+ "location_id" : location_id ,
179
+ "location_dest_id" : location_dest_id ,
180
+ },
181
+ ),
164
182
],
165
183
}
166
184
)
@@ -186,7 +204,7 @@ def test_pack_with_dont_move_the_parent(self):
186
204
def create_orderpoint (product , qty_min , qty_max , location , group ):
187
205
return self .env ["stock.warehouse.orderpoint" ].create (
188
206
{
189
- "name" : "OP/%s" % product .name ,
207
+ "name" : f "OP/{ product .name } " ,
190
208
"product_id" : product .id ,
191
209
"product_min_qty" : qty_min ,
192
210
"product_max_qty" : qty_max ,
@@ -203,7 +221,7 @@ def create_orderpoint(product, qty_min, qty_max, location, group):
203
221
self .env .ref ("stock.stock_location_stock" ),
204
222
pg ,
205
223
)
206
- self .env ["stock.scheduler.compute" ].create ({}).procure_calculation ()
224
+ # self.env["stock.scheduler.compute"].create({}).procure_calculation()
207
225
picking_ids = self .env ["stock.picking" ].search ([("group_id" , "=" , pg .id )])
208
226
# we need to ensure that only the compents of the packs are in the moves.
209
227
self .assertFalse (self .pack_dc_with_dm in picking_ids .move_ids .product_id )
0 commit comments