From 2b258dd24fbce9a9c774888e15db8d0d7d21fa86 Mon Sep 17 00:00:00 2001 From: Antonio Yamuta Date: Mon, 23 Apr 2018 17:52:16 +0000 Subject: [PATCH 1/2] [FIX]In current flow regardless if the product passed or not the last product from the list is returen as the product equivalent. Correct return product value to False instead of the last product value from the list in case no products passed the given condition. --- ddmrp_production_equivalent/__manifest__.py | 2 +- ddmrp_production_equivalent/models/mrp_production.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ddmrp_production_equivalent/__manifest__.py b/ddmrp_production_equivalent/__manifest__.py index ef1602e70..e87ca382a 100644 --- a/ddmrp_production_equivalent/__manifest__.py +++ b/ddmrp_production_equivalent/__manifest__.py @@ -4,7 +4,7 @@ { "name": "MRP BoM Equivalences when Production Order is Created", "summary": "Use equivalences of a part when appropriate", - "version": "11.0.1.0.1", + "version": "11.0.1.0.2", "license": "AGPL-3", "author": "Open Source Integrators, Odoo Community Association (OCA)", "category": "MRP", diff --git a/ddmrp_production_equivalent/models/mrp_production.py b/ddmrp_production_equivalent/models/mrp_production.py index 7b9fcb853..374318608 100644 --- a/ddmrp_production_equivalent/models/mrp_production.py +++ b/ddmrp_production_equivalent/models/mrp_production.py @@ -18,13 +18,14 @@ def _get_product_equivalent(self, bom_line, requested_qty): # exclude the non-equivalent parts listed in the BOM line and the # current product products -= bom_line.nonequivalent_product_ids + bom_line.product_id - product = False + product_eq = False for product in products: if product.orderpoint_ids and \ product.orderpoint_ids[0].planning_priority_level == '3_green': if product.qty_available > requested_qty: + product_eq = product break - return product + return product_eq def _generate_raw_move(self, bom_line, line_data): sm = super(MrpProduction, self)._generate_raw_move(bom_line, line_data) From d08b0ea0438b5c8db60e42ecf45ceaad0b918051 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Mon, 16 Jul 2018 10:40:29 -0500 Subject: [PATCH 2/2] Update README.rst --- ddmrp_production_equivalent/README.rst | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ddmrp_production_equivalent/README.rst b/ddmrp_production_equivalent/README.rst index 031dd4fad..d26c0c1a2 100644 --- a/ddmrp_production_equivalent/README.rst +++ b/ddmrp_production_equivalent/README.rst @@ -14,20 +14,22 @@ This module uses an equivalent part if the part on the BOM is not available.. Usage ===== + * Using DDMRP mechanism, If the main part on the BOM is not available (netflow position is in the red or yellow zone) and equivalences can be used, use the first part (based on priority) that have a netflow position in the green zone. * As an example, when a manufacturing order is created: - if Part A from the BOM is available (quantity on hand > requested quantity): - use Part A - Otherwise - If equivalences can be used: - Get all the other parts in the same product category - Exclude the non-equivalent parts listed in the BOM line - Sort the remaining parts by their priority - Use the first one - Otherwise: - Use Part A + +If Part A from the BOM is available (quantity on hand > requested quantity): + use Part A +Otherwise + If equivalences can be used: + Get all the other parts in the same product category + Exclude the non-equivalent parts listed in the BOM line + Sort the remaining parts by their priority + Use the first one + Otherwise: + Use Part A Bug Tracker ===========