Commit ffc2ef30 authored by Sebastien Robin's avatar Sebastien Robin

mrp: add few comments to understand better 'cr' and 'pr'

parent f8078f47
...@@ -71,6 +71,7 @@ class TransformationSimulationRule(RuleMixin, MovementCollectionUpdaterMixin): ...@@ -71,6 +71,7 @@ class TransformationSimulationRule(RuleMixin, MovementCollectionUpdaterMixin):
return (movement.getSource() is None or movement.getDestination() is None) return (movement.getSource() is None or movement.getDestination() is None)
def testTransformationSourcing(self, context): def testTransformationSourcing(self, context):
# make sure to ignore produced resources to keep consumed resources
if context.getReference().split('/', 1)[0] == 'pr': if context.getReference().split('/', 1)[0] == 'pr':
return False return False
# context consumes a resource: maybe sourcing is required. # context consumes a resource: maybe sourcing is required.
...@@ -156,8 +157,10 @@ class TransformationRuleMovementGenerator(MovementGeneratorMixin): ...@@ -156,8 +157,10 @@ class TransformationRuleMovementGenerator(MovementGeneratorMixin):
return movement return movement
for phase in phase_set: for phase in phase_set:
for previous in phase_dict[phase]: for previous in phase_dict[phase]:
# for consumed resource
yield newIntermediateMovement('cr/', previous, quantity=cr_quantity) yield newIntermediateMovement('cr/', previous, quantity=cr_quantity)
if phase not in final_set: if phase not in final_set:
# for produced resource
yield newIntermediateMovement('pr/', phase) yield newIntermediateMovement('pr/', phase)
movement = newMovement('pr') movement = newMovement('pr')
movement._setTradePhaseList(final_set) movement._setTradePhaseList(final_set)
......
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