From fd6d328a097503149c4b0b30f62baf4fb72a22d2 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 16 Sep 2021 09:48:06 +0200 Subject: [PATCH] [FIX] stock_available_mrp: variable referenced before assignment TT31916 --- stock_available_mrp/models/product_product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_available_mrp/models/product_product.py b/stock_available_mrp/models/product_product.py index fcd8af5c6..6bcc1b4b6 100644 --- a/stock_available_mrp/models/product_product.py +++ b/stock_available_mrp/models/product_product.py @@ -83,6 +83,7 @@ class ProductProduct(models.Model): # Need by product (same product can be in many BOM lines/levels) exploded_components = exploded_boms[product.id] component_needs = product._get_components_needs(exploded_components) + bom_id = product.bom_id if not component_needs: # The BoM has no line we can use potential_qty = immediately_usable_qty = 0.0 @@ -96,7 +97,6 @@ class ProductProduct(models.Model): ] ) - bom_id = product.bom_id potential_qty = bom_id.product_qty * components_potential_qty potential_qty = potential_qty > 0.0 and potential_qty or 0.0