Commit 15e9a579 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

TransformationRule: Do not copy target resource price on source resource

parent c1207a1e
......@@ -144,6 +144,7 @@ class TransformationRuleMovementGenerator(MovementGeneratorMixin):
amount.getCategoryList(),
base=True)
movement.quantity = - movement.quantity
movement.setPrice(movement.getResourceValue().getPrice())
yield movement
phase_dict = parent_movement.asComposedDocument() \
.getPreviousTradePhaseDict(phase_set)
......
  • OK except that I would pass context=movement to getPrice(). This allows to have predicate for looking to the right price depending on date, source, destination, etc

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