Commit 73a1db3d authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

testMRP: Update business process to use transformation_sourcing_internal_packing_list_builder

parent 7df8001b
...@@ -168,8 +168,10 @@ class TestMRPMixin(TestBPMMixin): ...@@ -168,8 +168,10 @@ class TestMRPMixin(TestBPMMixin):
Terms Terms
===== =====
PPL : Production Packing List PPL : Production Packing List
PR : Manufacturing Execution ME : Manufacturing Execution
PO : Production Order PO : Production Order
MO : Manufacturing Order
IPL : Internal Packing List
Context Context
======= =======
...@@ -198,14 +200,14 @@ class TestMRPMixin(TestBPMMixin): ...@@ -198,14 +200,14 @@ class TestMRPMixin(TestBPMMixin):
======================= =======================
order order p0 s0 p1 deliver order order p0 s0 p1 deliver
------- S0 ----- S1 ---- S2 ---- S3 ---- S4 -------- S5 ------- S0 ----- S1 ---- S2 ---- S3 ---- S4 -------- S5
PO MO ME1 PPL1 ME2 PPL2 PO MO ME1 IPL ME2 PPL
Simulation Tree Simulation Tree
=============== ===============
* PO / new_order_root_simulation_rule * PO / new_order_root_simulation_rule
* Production Order Line * Production Order Line
* default_delivering_rule * default_delivering_rule
* PPL2 * PPL
* default_production_rule * default_production_rule
* MO * MO
* default_transformation_rule * default_transformation_rule
...@@ -214,7 +216,7 @@ class TestMRPMixin(TestBPMMixin): ...@@ -214,7 +216,7 @@ class TestMRPMixin(TestBPMMixin):
* output ME1 - partial product * output ME1 - partial product
* input ME2 - partial product * input ME2 - partial product
* default_transformation_source_rule * default_transformation_source_rule
* PPL1 * IPL
* input ME2 * input ME2
* default_transformation_source_rule * default_transformation_source_rule
* input ME2 * input ME2
...@@ -225,12 +227,13 @@ class TestMRPMixin(TestBPMMixin): ...@@ -225,12 +227,13 @@ class TestMRPMixin(TestBPMMixin):
production_packing_list_builder = 'portal_deliveries/production_packing_list_builder' production_packing_list_builder = 'portal_deliveries/production_packing_list_builder'
manufacturing_execution_builder = 'portal_deliveries/manufacturing_execution_builder' manufacturing_execution_builder = 'portal_deliveries/manufacturing_execution_builder'
manufacturing_order_builder = 'portal_deliveries/manufacturing_order_builder' manufacturing_order_builder = 'portal_deliveries/manufacturing_order_builder'
sourcing_builder = 'portal_deliveries/transformation_sourcing_internal_packing_list_builder'
completed = 'delivered', 'started', 'stopped' completed = 'delivered', 'started', 'stopped'
phase_list = [ phase_list = [
('default/order', None, ('confirmed',)), ('default/order', None, ('confirmed',)),
('manufacturing/order', manufacturing_order_builder, ('confirmed',)), ('manufacturing/order', manufacturing_order_builder, ('confirmed',)),
('mrp/p0', manufacturing_execution_builder, completed), ('mrp/p0', manufacturing_execution_builder, completed),
('mrp/s0', production_packing_list_builder, completed), ('mrp/s0', sourcing_builder, completed),
('mrp/p1', manufacturing_execution_builder, completed), ('mrp/p1', manufacturing_execution_builder, completed),
('default/delivery', production_packing_list_builder, completed) ('default/delivery', production_packing_list_builder, completed)
] ]
...@@ -283,6 +286,10 @@ class TestMRPImplementation(TestMRPMixin): ...@@ -283,6 +286,10 @@ class TestMRPImplementation(TestMRPMixin):
self.tic() self.tic()
def testSimpleOrder(self): def testSimpleOrder(self):
"""
We test the process implemented in 'createBusinessProcess1' is
correctly followed
"""
self.createMRPOrder() self.createMRPOrder()
order = self.order order = self.order
...@@ -353,9 +360,9 @@ class TestMRPImplementation(TestMRPMixin): ...@@ -353,9 +360,9 @@ class TestMRPImplementation(TestMRPMixin):
variation = 'industrial_phase/trade_phase/mrp/p0' variation = 'industrial_phase/trade_phase/mrp/p0'
self.checkStock(resource, (self.workshop2, variation, 10)) self.checkStock(resource, (self.workshop2, variation, 10))
ppl1, = getRelatedDeliveryList("Production Packing List") ipl, = getRelatedDeliveryList("Internal Packing List")
ppl1.start() ipl.start()
ppl1.deliver() ipl.deliver()
order.localBuild() order.localBuild()
self.tic() self.tic()
self.checkStock(resource, (self.workshop, variation, 10)) self.checkStock(resource, (self.workshop, variation, 10))
...@@ -368,10 +375,10 @@ class TestMRPImplementation(TestMRPMixin): ...@@ -368,10 +375,10 @@ class TestMRPImplementation(TestMRPMixin):
self.tic() self.tic()
self.checkStock(resource, (self.workshop, '', 10)) self.checkStock(resource, (self.workshop, '', 10))
ppl2, = (x for x in getRelatedDeliveryList("Production Packing List") ppl, = (x for x in getRelatedDeliveryList("Production Packing List")
if x.aq_base is not ppl1.aq_base) if x.aq_base is not ipl.aq_base)
ppl2.start() ppl.start()
ppl2.deliver() ppl.deliver()
self.tic() self.tic()
self.checkStock(resource, (self.destination, '', 10)) self.checkStock(resource, (self.destination, '', 10))
......
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