mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[FIX] mrp_multi_level: Check BoM Line Attrs
add a call to mrp.bom.line._skip_bom_line() method fixes #505
This commit is contained in:
@@ -32,6 +32,11 @@ class TestMrpMultiLevelCommon(SavepointCase):
|
||||
cls.sf_2 = cls.env.ref("mrp_multi_level.product_product_sf_2")
|
||||
cls.pp_1 = cls.env.ref("mrp_multi_level.product_product_pp_1")
|
||||
cls.pp_2 = cls.env.ref("mrp_multi_level.product_product_pp_2")
|
||||
cls.product_4b = cls.env.ref("product.product_product_4b")
|
||||
cls.av_11 = cls.env.ref("mrp_multi_level.product_product_av_11")
|
||||
cls.av_12 = cls.env.ref("mrp_multi_level.product_product_av_12")
|
||||
cls.av_21 = cls.env.ref("mrp_multi_level.product_product_av_21")
|
||||
cls.av_22 = cls.env.ref("mrp_multi_level.product_product_av_22")
|
||||
cls.company = cls.env.ref("base.main_company")
|
||||
cls.mrp_area = cls.env.ref("mrp_multi_level.mrp_area_stock_wh0")
|
||||
cls.vendor = cls.env.ref("mrp_multi_level.res_partner_lazer_tech")
|
||||
@@ -201,7 +206,7 @@ class TestMrpMultiLevelCommon(SavepointCase):
|
||||
cls.product_scenario_1, 18, dt_next_group, location=cls.cases_loc
|
||||
)
|
||||
|
||||
# Create test picking for FP-1 and FP-2:
|
||||
# Create test picking for FP-1, FP-2 and Desk(steel, black):
|
||||
res = cls.calendar.plan_days(7 + 1, datetime.today().replace(hour=0))
|
||||
date_move = res.date()
|
||||
cls.picking_1 = cls.stock_picking_obj.create(
|
||||
@@ -239,6 +244,20 @@ class TestMrpMultiLevelCommon(SavepointCase):
|
||||
"location_dest_id": cls.customer_location.id,
|
||||
},
|
||||
),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"name": "Test move product-4b",
|
||||
"product_id": cls.product_4b.id,
|
||||
"date_expected": date_move,
|
||||
"date": date_move,
|
||||
"product_uom": cls.product_4b.uom_id.id,
|
||||
"product_uom_qty": 150,
|
||||
"location_id": cls.stock_location.id,
|
||||
"location_dest_id": cls.customer_location.id,
|
||||
},
|
||||
),
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
@@ -309,3 +309,30 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
|
||||
self.assertEqual(mrp_invs[0].to_procure, 130)
|
||||
# Net needs = 18, available on-hand = 3 -> 15
|
||||
self.assertEqual(mrp_invs[1].to_procure, 15)
|
||||
|
||||
def test_12_bom_line_attribute_value_skip(self):
|
||||
"""Check for the correct demand on components of a product with
|
||||
multiple variants"""
|
||||
product_4b_demand = self.mrp_inventory_obj.search(
|
||||
[("product_mrp_area_id.product_id", "=", self.product_4b.id)]
|
||||
)
|
||||
self.assertTrue(product_4b_demand)
|
||||
self.assertTrue(product_4b_demand.to_procure)
|
||||
# No demand or supply for AV-12 or AV-21
|
||||
av_12_supply = self.mrp_inventory_obj.search(
|
||||
[("product_mrp_area_id.product_id", "=", self.av_12.id)]
|
||||
)
|
||||
self.assertFalse(av_12_supply)
|
||||
av_21_supply = self.mrp_inventory_obj.search(
|
||||
[("product_mrp_area_id.product_id", "=", self.av_21.id)]
|
||||
)
|
||||
self.assertFalse(av_21_supply)
|
||||
# Supply for AV-11 and AV-22
|
||||
av_11_supply = self.mrp_inventory_obj.search(
|
||||
[("product_mrp_area_id.product_id", "=", self.av_11.id)]
|
||||
)
|
||||
self.assertTrue(av_11_supply)
|
||||
av_22_supply = self.mrp_inventory_obj.search(
|
||||
[("product_mrp_area_id.product_id", "=", self.av_22.id)]
|
||||
)
|
||||
self.assertTrue(av_22_supply)
|
||||
|
||||
Reference in New Issue
Block a user