Commit d8b183c7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

support mapped value in divergence testers.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33328 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cea90804
...@@ -437,7 +437,7 @@ class SimulationMovement(Movement, PropertyRecordableMixin): ...@@ -437,7 +437,7 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
Look are invocations of _isProfitAndLossMovement in Look are invocations of _isProfitAndLossMovement in
ERP5.mixin.rule to understand how. ERP5.mixin.rule to understand how.
""" """
quantity = self.getQuantity() quantity = self.getMappedProperty('quantity')
profit_quantity = self.getProfitQuantity() or 0 profit_quantity = self.getProfitQuantity() or 0
delivery_error = self.getDeliveryError() or 0 delivery_error = self.getDeliveryError() or 0
return quantity - profit_quantity + delivery_error return quantity - profit_quantity + delivery_error
......
...@@ -70,13 +70,14 @@ class CategoryDivergenceTester(PropertyDivergenceTester): ...@@ -70,13 +70,14 @@ class CategoryDivergenceTester(PropertyDivergenceTester):
tested_property = self.getTestedPropertyList() tested_property = self.getTestedPropertyList()
delivery_mvt = simulation_movement.getDeliveryValue() delivery_mvt = simulation_movement.getDeliveryValue()
delivery_mvt_getProperty = delivery_mvt.getProperty
simulation_movement_getProperty = simulation_movement.getMappedProperty
for tested_property_id, tested_property_title in \ for tested_property_id, tested_property_title in \
self._splitStringList(tested_property): self._splitStringList(tested_property):
list_prop = '%s_list' % tested_property_id
message = None message = None
delivery_mvt_category_list = \ delivery_mvt_category_list = delivery_mvt_getProperty(list_prop)
delivery_mvt.getPropertyList(tested_property_id) simulation_category_list = simulation_movement_getProperty(list_prop)
simulation_category_list = \
simulation_movement.getPropertyList(tested_property_id)
# XXX Don't we need to check the order too ? # XXX Don't we need to check the order too ?
delivery_mvt_category_list.sort() delivery_mvt_category_list.sort()
......
...@@ -81,10 +81,12 @@ class PropertyDivergenceTester(XMLObject): ...@@ -81,10 +81,12 @@ class PropertyDivergenceTester(XMLObject):
tested_property = self.getTestedPropertyList() tested_property = self.getTestedPropertyList()
delivery_mvt = simulation_movement.getDeliveryValue() delivery_mvt = simulation_movement.getDeliveryValue()
delivery_mvt_getProperty = delivery_mvt.getProperty
simulation_movement_getProperty = simulation_movement.getMappedProperty
for tested_property_id, tested_property_title in \ for tested_property_id, tested_property_title in \
self._splitStringList(tested_property): self._splitStringList(tested_property):
delivery_mvt_property = delivery_mvt.getProperty(tested_property_id) delivery_mvt_property = delivery_mvt_getProperty(tested_property_id)
simulation_mvt_property = simulation_movement.getProperty(tested_property_id) simulation_mvt_property = simulation_movement_getProperty(tested_property_id)
if delivery_mvt_property != simulation_mvt_property: if delivery_mvt_property != simulation_mvt_property:
message = DivergenceMessage( message = DivergenceMessage(
divergence_scope='property', divergence_scope='property',
......
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