diff --git a/stock_available_mrp/__manifest__.py b/stock_available_mrp/__manifest__.py index 114ddfa8e..41d8d762e 100644 --- a/stock_available_mrp/__manifest__.py +++ b/stock_available_mrp/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Consider the production potential is available to promise", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "author": "Numérigraphe," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/stock-logistics-warehouse", "category": "Hidden", diff --git a/stock_available_mrp/models/product_product.py b/stock_available_mrp/models/product_product.py index fcd8af5c6..988f10544 100644 --- a/stock_available_mrp/models/product_product.py +++ b/stock_available_mrp/models/product_product.py @@ -126,7 +126,7 @@ class ProductProduct(models.Model): @api.model def _get_components_needs(self, exploded_components): - """ Return the needed qty of each compoments in the exploded_components + """Return the needed qty of each compoments in the exploded_components :type exploded_components :rtype: collections.Counter diff --git a/stock_available_mrp/tests/test_potential_qty.py b/stock_available_mrp/tests/test_potential_qty.py index 022e0f58c..301a617bf 100644 --- a/stock_available_mrp/tests/test_potential_qty.py +++ b/stock_available_mrp/tests/test_potential_qty.py @@ -43,6 +43,11 @@ class TestPotentialQty(TransactionCase): # Zero-out the inventory of all variants and components for component in components + [v for v in self.tmpl.product_variant_ids]: + moves = component.stock_move_ids.filtered( + lambda mo: mo.state not in ("done", "cancel") + ) + moves._action_cancel() + component.stock_quant_ids.unlink() #  A product without a BoM @@ -87,15 +92,12 @@ class TestPotentialQty(TransactionCase): self._create_inventory_line(inventory.id, product_id, location_id, qty) inventory._action_done() - def create_simple_bom( - self, product, sub_product, product_qty=1, sub_product_qty=1, routing_id=False - ): + def create_simple_bom(self, product, sub_product, product_qty=1, sub_product_qty=1): bom = self.bom_model.create( { "product_tmpl_id": product.product_tmpl_id.id, "product_id": product.id, "product_qty": product_qty, - "routing_id": routing_id, } ) self.bom_line_model.create(