Commit 71a44eac authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

testMRP: Add documentation

parent f0e02c79
......@@ -163,12 +163,58 @@ class TestMRPMixin(TestBPMMixin):
def createBusinessProcess1(self, node_p0=None):
"""
Terms
=====
PPL : Production Packing List
PR : Manufacturing Execution
PO : Production Order
Context
=======
The transformation used in this business process is split into two part,
this is configured by using transformed resource lines with different
trade phases.
Business Process
================
The Business process will proceed this way:
1/ Generate Production Order and confirm it
2/ Generate Manufacturing Execution p0 which generate a
the product with a variation to indicate it is a partial product.
The variation is trade_phase/mrp/p0. It takes place in workshop2
3/ Delivering the first Manufacturing Execution leads to the build
of a Production Packing List to move the delivered half built product
from "workshop2" to "workshop" the next fabrication line.
4/ Delivering the PPL will build the second Manufacturing Execution p1
which takes as input the variated expected product and resource 3 and 4.
It takes place in "workshop" node
5/ Delivering p1 will build the last production packing List with source
"workshop" and destination "destination"
Business Process Schema
=======================
order p0 s0 p1 deliver
------- S0 ---- S1 ---- S2 ---- S3 ------- S4
PO PR PPL PR PPL
PO ME1 PPL1 ME2 PPL2
Simulation Tree
===============
* PO / new_order_root_simulation_rule
* Production Order Line
* default_delivering_rule
* PPL2
* default_transformation_rule
* input ME1
* input ME1
* output ME1 - partial product
* input ME2 - partial product
* default_transformation_source_rule
* PPL1
* input ME2
* default_transformation_source_rule
* input ME2
* default_transformation_source_rule
* output ME2
"""
business_process = self._createDocument("Business Process")
builder = 'portal_deliveries/production_packing_list_builder'
......@@ -234,22 +280,31 @@ class TestMRPImplementation(TestMRPMixin):
self.createMRPOrder()
order = self.order
# new_order_root_simulation_rule
ar, = order.getCausalityRelatedValueList(portal_type="Applied Rule")
sm, = ar.objectValues() # order
# Production Order Line
sm, = ar.objectValues()
# default_delivering_rule
ar, = sm.objectValues()
# The final PPL
sm, = ar.objectValues() # deliver
# default_transformation_rule
ar, = sm.objectValues()
movement_list = []
resource = self.order_line.getResource()
# This is the list of movement generated by the transformation rule.
for sm in ar.objectValues():
self.assertEqual(sm.getSource(), None)
self.assertTrue(sm.getDestination())
# Reference is used to match movements when reexpanding.
reference = sm.getReference()
# Theses are the intermediary movement
if reference.split('/', 1)[0] in ('pr', 'cr'):
self.assertEqual(sm.getResource(), resource)
else:
# The reference is the transformation line, so we assert the resource
# of the movement is the same as the corresponding line.
cr = self.portal.unrestrictedTraverse(reference).getResource()
self.assertTrue(None != sm.getResource() == cr != resource)
reference = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment