Commit b5be9c89 authored by Aurel's avatar Aurel

Only update those updatable properties which are not recorded - done

with JPS



git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@37457 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d6c45430
......@@ -413,7 +413,14 @@ class RuleMixin:
kw = {}
for tester in profit_updating_tester_list:
if not tester.compare(prevision_movement, decision_movement):
kw.update(tester.getUpdatablePropertyDict(prevision_movement, decision_movement))
# Only update those updatable properties which are not recorded
kw_candidate = tester.getUpdatablePropertyDict(prevision_movement,
decision_movement)
accept_candidate = True
for property_key in kw_candidate.keys():
if decision_movement.isPropertyRecorded(property_key):
del kw_candidate[property_key]
kw.update(kw_candidate)
if kw:
movement_collection_diff.addUpdatableMovement(decision_movement, kw)
else:
......@@ -429,7 +436,14 @@ class RuleMixin:
kw = {}
for tester in updating_tester_list:
if not tester.compare(prevision_movement, decision_movement):
kw.update(tester.getUpdatablePropertyDict(prevision_movement, decision_movement))
# Only update those updatable properties which are not recorded
kw_candidate = tester.getUpdatablePropertyDict(prevision_movement,
decision_movement)
accept_candidate = True
for property_key in kw_candidate.keys():
if decision_movement.isPropertyRecorded(property_key):
del kw_candidate[property_key]
kw.update(kw_candidate)
# XXX-JPS - there is a risk here that quanity is wrongly updated
if kw:
movement_collection_diff.addUpdatableMovement(decision_movement, kw)
......
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