Commit 9b4dbe2c authored by Sebastien Robin's avatar Sebastien Robin

simulation: identify the trade model path used for generating a simulation movement

A business process can define several trade model path for a single trade phase.
This will generate several simulation movement per rule input simulation movement.

When reexpanding a simulation tree, we have to do matching between generated
movement and existing simulation movements. Up to now, we do indirect matching
by looking at property that would be updated by trade model path (like source
or destination). But this indirect way is inconvenient and does not work as
expected when one of the matching property is changed.

It would be more convenient and more reliable to check directly from which
trade model path comes a simulation movement.

As an exemple, this is particular useful in the case of accounting, where in the
invoice transaction rule we usually generate an "accounting+" and an "accounting-"
movement through two distincts trade model path.
parent c413d34b
......@@ -774,6 +774,12 @@ class BusinessProcess(Path, XMLObject):
if value:
property_dict[base_category] = value
# Allow to identify a trade model path by it's reference for possibly doing
# matching in simulation
reference = trade_model_path.getReference()
if reference:
property_dict['trade_model_path_reference'] = reference
# Amount quantities - XXX-JPS maybe we should consider handling unit conversions here
# and specifying units
if trade_model_path.getQuantity():
......
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