Commit 848ec7e7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

introduce 'updating_provider' property with that we can specify which tester...

introduce 'updating_provider' property with that we can specify which tester should be used for updating.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32179 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8500f5b7
......@@ -49,4 +49,9 @@ class DivergenceTester:
'type' : 'boolean',
'default' : 0,
'mode' : 'rw' },
{ 'id' : 'updating_provider',
'description' : 'Defines whether a divergence tester acts as a updating provider.',
'type' : 'boolean',
'default' : 1,
'mode' : 'rw' },
)
......@@ -258,7 +258,9 @@ class RuleMixin:
# let us imagine the case of a forward rule
# ie. what comes in must either go out or has been lost
divergence_tester_list = self._getDivergenceTesterList()
profit_tester_list = self._getDivergenceTesterList()
profit_tester_list = divergence_tester_list
updating_tester_list = self._getUpdatingTesterList()
profit_updating_tester_list = updating_tester_list
quantity_tester_list = self._getQuantityTesterList()
compensated_quantity = 0.0
updatable_movement = None
......@@ -288,7 +290,7 @@ class RuleMixin:
updatable_compensation_movement = decision_movement
# Not Frozen can be updated
kw = {}
for tester in profit_tester_list:
for tester in profit_updating_tester_list:
if not tester.compare(prevision_movement, decision_movement):
kw.update(tester.getUpdatablePropertyDict(prevision_movement, decision_movement))
if kw:
......@@ -304,7 +306,7 @@ class RuleMixin:
updatable_movement = decision_movement
# Not Frozen can be updated
kw = {}
for tester in divergence_tester_list:
for tester in updating_tester_list:
if not tester.compare(prevision_movement, decision_movement):
kw.update(tester.getUpdatablePropertyDict(prevision_movement, decision_movement))
# XXX-JPS - there is a risk here that quanity is wrongly updated
......
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