Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
71a44eac
Commit
71a44eac
authored
Oct 26, 2017
by
Cédric Le Ninivin
Committed by
Cédric Le Ninivin
Nov 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testMRP: Add documentation
parent
f0e02c79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
2 deletions
+57
-2
product/ERP5/tests/testMRP.py
product/ERP5/tests/testMRP.py
+57
-2
No files found.
product/ERP5/tests/testMRP.py
View file @
71a44eac
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment