Commit 0b1f2444 authored by Rafael Monnerat's avatar Rafael Monnerat

identation fix.

Comment one useless condition.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10147 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 61c305f4
...@@ -127,31 +127,33 @@ class CopyToTarget(TargetSolver): ...@@ -127,31 +127,33 @@ class CopyToTarget(TargetSolver):
parent_movement, parent_value_delta_dict = \ parent_movement, parent_value_delta_dict = \
self._getParentParameters(simulation_movement, **value_delta_dict) self._getParentParameters(simulation_movement, **value_delta_dict)
if parent_movement is not None and parent_movement.isFrozen(): #if parent is not None and parent_movement.isFrozen():
# If backtraxcking is not possible, we have to make sure that the # If backtraxcking is not possible, we have to make sure that the
# divergence is solved locally by using profit and loss # divergence is solved locally by using profit and loss
sm_quantity = simulation_movement.getQuantity() # sm_quantity = simulation_movement.getQuantity()
delivery_quantity = \ # delivery_quantity = \
simulation_movement.getDeliveryValue().getQuantity() # simulation_movement.getDeliveryValue().getQuantity()
# simulation_movement.edit( # simulation_movement.edit(
# profit_quantity=sm_quantity - delivery_quantity) # profit_quantity=sm_quantity - delivery_quantity)
else: #else:
# fix foating point rounding error if is_last_movement:
if is_last_movement:
delivery_quantity = \ delivery_quantity = \
simulation_movement.getDeliveryValue().getQuantity() simulation_movement.getDeliveryValue().getQuantity()
simulation_movement.setDeliveryError(delivery_quantity - simulation_movement.setDeliveryError(delivery_quantity -
value_dict['quantity']) value_dict['quantity'])
delivery = simulation_movement.getDeliveryValue()
simulation_movement.setDestination(delivery.getDestination()) delivery = simulation_movement.getDeliveryValue()
simulation_movement.setSource(delivery.getSource())
simulation_movement.setDestinationSection(delivery.getDestinationSection()) # XXX Hardcoded Set
simulation_movement.setSourceSection(delivery.getSourceSection()) simulation_movement.setDestination(delivery.getDestination())
simulation_movement.setSource(delivery.getSource())
simulation_movement.edit(**value_dict) simulation_movement.setDestinationSection(delivery.getDestinationSection())
if parent_movement is not None: simulation_movement.setSourceSection(delivery.getSourceSection())
simulation_movement.edit(**value_dict)
if parent_movement is not None and not parent_movement.isFrozen():
# backtrack to the parent movement only if it is not frozen # backtrack to the parent movement only if it is not frozen
self._recursivelySolve(parent_movement, is_last_movement=0, self._recursivelySolve(parent_movement, is_last_movement=0,
**parent_value_delta_dict) **parent_value_delta_dict)
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