@@ -178,6 +178,37 @@ def test_compute_quantities_dict(self):
178178 self .assertEqual (self .pack_dc .virtual_available , 5 )
179179 self .assertEqual (self .pack_dc .qty_available , 5 )
180180
181+ def test_is_pack_dont_create_move (self ):
182+ procurement_group = self .env ["procurement.group" ]
183+ category_all_id = self .env .ref ("product.product_category_all" ).id
184+
185+ self .assertTrue (
186+ procurement_group .is_pack_dont_create_move (self .pack_dc_with_dm )
187+ )
188+ self .assertFalse (procurement_group .is_pack_dont_create_move (self .pack_dc ))
189+
190+ non_detailed_pack = self .product_obj .create (
191+ {
192+ "name" : "Non-detailed pack with don't create move" ,
193+ "detailed_type" : "product" ,
194+ "pack_ok" : True ,
195+ "dont_create_move" : True ,
196+ "pack_type" : "non_detailed" ,
197+ "categ_id" : category_all_id ,
198+ }
199+ )
200+ self .assertFalse (procurement_group .is_pack_dont_create_move (non_detailed_pack ))
201+
202+ not_a_pack = self .product_obj .create (
203+ {
204+ "name" : "Not a pack with don't create move" ,
205+ "detailed_type" : "product" ,
206+ "dont_create_move" : True ,
207+ "categ_id" : category_all_id ,
208+ }
209+ )
210+ self .assertFalse (procurement_group .is_pack_dont_create_move (not_a_pack ))
211+
181212 def test_pack_with_dont_move_the_parent (self ):
182213 """Run a procurement for prod pack products when there are only 5 in stock then
183214 check that MTO is applied on the moves when the rule is set to 'mts_else_mto'
0 commit comments