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 allow checking directly from which trade model path comes a simulation movement. So add property trade_model_path_reference on simulation movements, and then we are free to do matching on it if we want.
As an example, 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 distinct trade model path.
@jm @jerome @kazuhiko, can you please let me know your though on such change. This will add a property "trade_model_path_reference" on all simulation movements. But this should not affect existing simulation since usually we will just not look at this property. Do you see better ways ?
I will update erp5_configurator_standard_invoicing_template and add unit test before merging once solution is agreed.