Commit e7afdbd4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* we need to care recorded properties for decision_movement, not prevision_movement in compare().

* no need to care recorded properties in getUpdatablePropertyDict().


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31071 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e880893b
......@@ -65,10 +65,10 @@ class CategoryMembershipDivergenceTester(Predicate, DivergenceTesterMixin):
list : (prevision_value, decision_value, message, mapping)
"""
tested_property = self.getTestedProperty()
decision_value = decision_movement.getPropertyList(tested_property)
if prevision_movement.isPropertyRecorded(tested_property):
prevision_value = prevision_movement.getRecordedProperty(tested_property)
if getattr(decision_movement, 'isPropertyRecorded', lambda:False)():
decision_value = decision_movement.getRecordedProperty(tested_property)
else:
decision_value = decision_movement.getPropertyList(tested_property)
prevision_value = prevision_movement.getPropertyList(tested_property)
# XXX do we have configurable parameter for this divergence tester ?
......@@ -90,9 +90,6 @@ class CategoryMembershipDivergenceTester(Predicate, DivergenceTesterMixin):
decision_movement -- a delivery movement (decision)
"""
tested_property = self.getTestedProperty()
if prevision_movement.isPropertyRecorded(tested_property):
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else:
prevision_value = prevision_movement.getPropertyList(tested_property)
return {tested_property:prevision_value}
......
......@@ -67,12 +67,10 @@ class FloatDivergenceTester(Predicate, DivergenceTesterMixin):
list : (prevision_value, decision_value, message, mapping)
"""
tested_property = self.getTestedProperty()
decision_value = decision_movement.getProperty(tested_property)
if self.getProperty('delivery_ratio_enabled'):
decision_value *= prevision_movement.getDeliveryRatio()
if prevision_movement.isPropertyRecorded(tested_property):
prevision_value = prevision_movement.getRecordedProperty(tested_property)
if getattr(decision_movement, 'isPropertyRecorded', lambda:False)():
decision_value = decision_movement.getRecordedProperty(tested_property)
else:
decision_value = decision_movement.getProperty(tested_property)
prevision_value = prevision_movement.getProperty(tested_property)
delta = decision_value - prevision_value
......@@ -156,9 +154,6 @@ class FloatDivergenceTester(Predicate, DivergenceTesterMixin):
decision_movement -- a delivery movement (decision)
"""
tested_property = self.getTestedProperty()
if prevision_movement.isPropertyRecorded(tested_property):
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else:
prevision_value = prevision_movement.getProperty(tested_property)
return {tested_property:prevision_value}
......
......@@ -68,10 +68,10 @@ class StringDivergenceTester(Predicate, DivergenceTesterMixin):
list : (prevision_value, decision_value, message, mapping)
"""
tested_property = self.getTestedProperty()
decision_value = decision_movement.getProperty(tested_property)
if prevision_movement.isPropertyRecorded(tested_property):
prevision_value = prevision_movement.getRecordedProperty(tested_property)
if getattr(decision_movement, 'isPropertyRecorded', lambda:False)():
decision_value = decision_movement.getRecordedProperty(tested_property)
else:
decision_value = decision_movement.getProperty(tested_property)
prevision_value = prevision_movement.getProperty(tested_property)
# XXX do we have configurable parameter for this divergence tester ?
......@@ -93,9 +93,6 @@ class StringDivergenceTester(Predicate, DivergenceTesterMixin):
decision_movement -- a delivery movement (decision)
"""
tested_property = self.getTestedProperty()
if prevision_movement.isPropertyRecorded(tested_property):
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else:
prevision_value = prevision_movement.getProperty(tested_property)
return {tested_property:prevision_value}
......
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