Skip to content

Commit

Permalink
Merge pull request #14 from agyamuta/11.0-fix-no-prod-equivalent-logic
Browse files Browse the repository at this point in the history
[FIX]In current flow regardless if the product passed or not the last…
  • Loading branch information
LoisRForgeFlow authored Jul 16, 2018
2 parents 8942f20 + d08b0ea commit 8620e4f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
22 changes: 12 additions & 10 deletions ddmrp_production_equivalent/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
===========
Expand Down
2 changes: 1 addition & 1 deletion ddmrp_production_equivalent/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions ddmrp_production_equivalent/models/mrp_production.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8620e4f

Please sign in to comment.