Commit 6277cab2 authored by Sebastien Robin's avatar Sebastien Robin

simulation: define _isProfitAndLossMovement in TransformationSimulationRule

parent e970d2cf
...@@ -65,6 +65,11 @@ class TransformationSimulationRule(RuleMixin, MovementCollectionUpdaterMixin): ...@@ -65,6 +65,11 @@ class TransformationSimulationRule(RuleMixin, MovementCollectionUpdaterMixin):
""" """
return TransformationRuleMovementGenerator(applied_rule=context, rule=self) return TransformationRuleMovementGenerator(applied_rule=context, rule=self)
def _isProfitAndLossMovement(self, movement):
# For a kind of trade rule, a profit and loss movement lacks source
# or destination.
return (movement.getSource() is None or movement.getDestination() is None)
def testTransformationSourcing(self, context): def testTransformationSourcing(self, context):
if context.getReference().split('/', 1)[0] == 'pr': if context.getReference().split('/', 1)[0] == 'pr':
return False return False
......
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