Commit 5ced9db0 authored by Guillaume Michon's avatar Guillaume Michon

solve() -> solveMovement()


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5882 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2677c7e2
...@@ -40,7 +40,7 @@ class ProfitAndLoss(CopyToTarget): ...@@ -40,7 +40,7 @@ class ProfitAndLoss(CopyToTarget):
on the parent applied rule. on the parent applied rule.
""" """
def solve(self, movement, new_target=None): def solveMovement(self, movement, new_target=None):
""" """
Movement difference as a profit (ie. a quantity coming from nowhere) Movement difference as a profit (ie. a quantity coming from nowhere)
Accumulate into delivered movement Accumulate into delivered movement
...@@ -51,9 +51,7 @@ class ProfitAndLoss(CopyToTarget): ...@@ -51,9 +51,7 @@ class ProfitAndLoss(CopyToTarget):
if delivery_line_quantity is not None: if delivery_line_quantity is not None:
target_quantity = delivery_line_quantity * movement.getDeliveryRatio() target_quantity = delivery_line_quantity * movement.getDeliveryRatio()
added_quantity = movement.getQuantity() - target_quantity added_quantity = movement.getQuantity() - target_quantity
#movement.setProfitQuantity(added_quantity)
movement.edit(profit_quantity=added_quantity) movement.edit(profit_quantity=added_quantity)
#movement.immediateReindexObject()
delivery = movement.getDeliveryValue() delivery = movement.getDeliveryValue()
if delivery is not None: if delivery is not None:
delivery.activate(after_path_and_method_id=(movement.getPath(), ['immediateReindexObject', 'recursiveImmediateReindexObject'])).edit() delivery.activate(after_path_and_method_id=(movement.getPath(), ['immediateReindexObject', 'recursiveImmediateReindexObject'])).edit()
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