[11.0][FIX] mrp_multi_level: pass a context to exclude hook when exploding.

This commit is contained in:
Lois Rilo
2019-06-03 13:42:06 +02:00
committed by Lois Rilo
parent a0445e96b8
commit ebe2e8a4d4

View File

@@ -221,7 +221,7 @@ class MultiLevelMrp(models.TransientModel):
if bomline.product_qty <= 0.00 or \
bomline.product_id.type != 'product':
continue
if self._exclude_from_mrp(
if self.with_context(mrp_explosion=True)._exclude_from_mrp(
bomline.product_id,
product_mrp_area_id.mrp_area_id):
# Stop explosion.
@@ -745,6 +745,10 @@ class MultiLevelMrp(models.TransientModel):
for product_mrp_area in product_mrp_area_ids:
# Build the time-phased inventory
if self._exclude_from_mrp(
product_mrp_area.product_id,
product_mrp_area.mrp_area_id):
continue
self._init_mrp_inventory(product_mrp_area)
logger.info('End MRP final process')