Commit c70327ab authored by Romain Courteaud's avatar Romain Courteaud

Remove checkConsistency implementation, which was done for Coramy, and not used

anymore.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3778 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e8890452
...@@ -296,40 +296,40 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated): ...@@ -296,40 +296,40 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated):
self.setTargetQuantity(quantity) self.setTargetQuantity(quantity)
security.declarePrivate('_checkConsistency') # security.declarePrivate('_checkConsistency')
def _checkConsistency(self, fixit=0, mapped_value_property_list = ('quantity', 'price')): # def _checkConsistency(self, fixit=0, mapped_value_property_list = ('quantity', 'price')):
""" # """
Check the constitency of transformation elements # Check the constitency of transformation elements
""" # """
error_list = XMLMatrix._checkConsistency(self, fixit=fixit) # error_list = XMLMatrix._checkConsistency(self, fixit=fixit)
#
# First quantity # # First quantity
# We build an attribute equality and look at all cells # # We build an attribute equality and look at all cells
q_constraint = Constraint.AttributeEquality( # q_constraint = Constraint.AttributeEquality(
domain_base_category_list = self.getVariationBaseCategoryList(), # domain_base_category_list = self.getVariationBaseCategoryList(),
predicate_operator = 'SUPERSET_OF', # predicate_operator = 'SUPERSET_OF',
mapped_value_property_list = mapped_value_property_list ) # mapped_value_property_list = mapped_value_property_list )
for k in self.getCellKeys(base_id = 'movement'): # for k in self.getCellKeys(base_id = 'movement'):
kw={} # kw={}
kw['base_id'] = 'movement' # kw['base_id'] = 'movement'
c = self.getCell(*k, **kw) # c = self.getCell(*k, **kw)
if c is not None: # if c is not None:
predicate_value = [] # predicate_value = []
for p in k: # for p in k:
if p is not None: predicate_value += [p] # if p is not None: predicate_value += [p]
q_constraint.edit(predicate_value_list = predicate_value) # q_constraint.edit(predicate_value_list = predicate_value)
if fixit: # if fixit:
error_list += q_constraint.fixConsistency(c) # error_list += q_constraint.fixConsistency(c)
else: # else:
error_list += q_constraint.checkConsistency(c) # error_list += q_constraint.checkConsistency(c)
if list(c.getVariationCategoryList()) != predicate_value: # if list(c.getVariationCategoryList()) != predicate_value:
error_message = "Variation %s but sould be %s" % (c.getVariationCategoryList(),predicate_value) # error_message = "Variation %s but sould be %s" % (c.getVariationCategoryList(),predicate_value)
if fixit: # if fixit:
c.setVariationCategoryList(predicate_value) # c.setVariationCategoryList(predicate_value)
error_message += " (Fixed)" # error_message += " (Fixed)"
error_list += [(c.getRelativeUrl(), 'VariationCategoryList inconsistency', 100, error_message)] # error_list += [(c.getRelativeUrl(), 'VariationCategoryList inconsistency', 100, error_message)]
#
return error_list # return error_list
# Simulation Consistency Check # Simulation Consistency Check
def getSimulationQuantity(self): def getSimulationQuantity(self):
......
...@@ -68,13 +68,13 @@ class OrderLine(DeliveryLine): ...@@ -68,13 +68,13 @@ class OrderLine(DeliveryLine):
# We must expand our applied rule if needed # We must expand our applied rule if needed
self.updateAppliedRule() # Actually called on parent self.updateAppliedRule() # Actually called on parent
security.declarePrivate('_checkConsistency') # security.declarePrivate('_checkConsistency')
def _checkConsistency(self, fixit=0, mapped_value_property_list = ('quantity', 'price')): # def _checkConsistency(self, fixit=0, mapped_value_property_list = ('quantity', 'price')):
""" # """
Check the constitency of transformation elements # Check the constitency of transformation elements
""" # """
return DeliveryLine._checkConsistency(self, fixit=fixit, mapped_value_property_list=mapped_value_property_list) # return DeliveryLine._checkConsistency(self, fixit=fixit, mapped_value_property_list=mapped_value_property_list)
#
def applyToOrderLineRelatedMovement(self, portal_type='Simulation Movement', method_id = 'expand'): def applyToOrderLineRelatedMovement(self, portal_type='Simulation Movement', method_id = 'expand'):
""" """
Warning: does not work if it was not catalogued immediately Warning: does not work if it was not catalogued immediately
......
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