Migrate stock_available_mrp to v14

This commit is contained in:
Florian da Costa
2021-05-27 18:14:35 +02:00
parent ced0d8a66b
commit 45a6669428
5 changed files with 15 additions and 6 deletions

View File

@@ -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",

View File

@@ -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

View File

@@ -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(