mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Migrate stock_available_mrp to v14
This commit is contained in:
1
setup/stock_available_mrp/odoo/addons/stock_available_mrp
Symbolic link
1
setup/stock_available_mrp/odoo/addons/stock_available_mrp
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../../stock_available_mrp
|
||||||
6
setup/stock_available_mrp/setup.py
Normal file
6
setup/stock_available_mrp/setup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
{
|
{
|
||||||
"name": "Consider the production potential is available to promise",
|
"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)",
|
"author": "Numérigraphe," "Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||||
"category": "Hidden",
|
"category": "Hidden",
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class ProductProduct(models.Model):
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _get_components_needs(self, exploded_components):
|
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
|
:type exploded_components
|
||||||
:rtype: collections.Counter
|
:rtype: collections.Counter
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ class TestPotentialQty(TransactionCase):
|
|||||||
|
|
||||||
# Zero-out the inventory of all variants and components
|
# Zero-out the inventory of all variants and components
|
||||||
for component in components + [v for v in self.tmpl.product_variant_ids]:
|
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()
|
component.stock_quant_ids.unlink()
|
||||||
|
|
||||||
# A product without a BoM
|
# A product without a BoM
|
||||||
@@ -87,15 +92,12 @@ class TestPotentialQty(TransactionCase):
|
|||||||
self._create_inventory_line(inventory.id, product_id, location_id, qty)
|
self._create_inventory_line(inventory.id, product_id, location_id, qty)
|
||||||
inventory._action_done()
|
inventory._action_done()
|
||||||
|
|
||||||
def create_simple_bom(
|
def create_simple_bom(self, product, sub_product, product_qty=1, sub_product_qty=1):
|
||||||
self, product, sub_product, product_qty=1, sub_product_qty=1, routing_id=False
|
|
||||||
):
|
|
||||||
bom = self.bom_model.create(
|
bom = self.bom_model.create(
|
||||||
{
|
{
|
||||||
"product_tmpl_id": product.product_tmpl_id.id,
|
"product_tmpl_id": product.product_tmpl_id.id,
|
||||||
"product_id": product.id,
|
"product_id": product.id,
|
||||||
"product_qty": product_qty,
|
"product_qty": product_qty,
|
||||||
"routing_id": routing_id,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
self.bom_line_model.create(
|
self.bom_line_model.create(
|
||||||
|
|||||||
Reference in New Issue
Block a user