[Erp5-report] r40917 arnaud.fontaine - in /erp5/trunk/products: ERP5/Constraint/ ERP5Type/C...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Nov 30 11:08:34 CET 2010


Author: arnaud.fontaine
Date: Tue Nov 30 11:08:34 2010
New Revision: 40917

URL: http://svn.erp5.org?rev=40917&view=rev
Log:
Add missing condition checks for filesystem Constraints


Modified:
    erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py
    erp5/trunk/products/ERP5/Constraint/BudgetConsumptionFeasability.py
    erp5/trunk/products/ERP5/Constraint/DocumentReferenceConstraint.py
    erp5/trunk/products/ERP5/Constraint/ResourceMeasuresConsistency.py
    erp5/trunk/products/ERP5/Constraint/TradeModelLineCellConsistency.py
    erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueFeasability.py
    erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueValidity.py
    erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py

Modified: erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py?rev=40917&r1=40916&r2=40917&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py [utf8] Tue Nov 30 11:08:34 2010
@@ -61,6 +61,9 @@ class AccountTypeConstraint(Constraint):
   def checkConsistency(self, obj, fixit=0):
     """Implement here the consistency checker
     """
+    if not self._checkConstraintCondition(obj):
+      return []
+
     errors = []
     if getattr(obj, 'getAccountType', _MARKER) is _MARKER:
       errors.append(self._generateError(

Modified: erp5/trunk/products/ERP5/Constraint/BudgetConsumptionFeasability.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Constraint/BudgetConsumptionFeasability.py?rev=40917&r1=40916&r2=40917&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Constraint/BudgetConsumptionFeasability.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Constraint/BudgetConsumptionFeasability.py [utf8] Tue Nov 30 11:08:34 2010
@@ -37,6 +37,9 @@ class BudgetConsumptionFeasability(Const
       """
       Check if there is enough budget to consumed.
       """
+      if not self._checkConstraintCondition(object):
+        return []
+
       errors = []
 
       new_category_list = []

Modified: erp5/trunk/products/ERP5/Constraint/DocumentReferenceConstraint.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Constraint/DocumentReferenceConstraint.py?rev=40917&r1=40916&r2=40917&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Constraint/DocumentReferenceConstraint.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Constraint/DocumentReferenceConstraint.py [utf8] Tue Nov 30 11:08:34 2010
@@ -58,6 +58,9 @@ class DocumentReferenceConstraint(Constr
     """
       Implement here the consistency checker
     """
+    if not self._checkConstraintCondition(document):
+      return []
+
     # XXX we probably could check reference syntax here, based on regexp in
     # preferences?
     error_list = []

Modified: erp5/trunk/products/ERP5/Constraint/ResourceMeasuresConsistency.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Constraint/ResourceMeasuresConsistency.py?rev=40917&r1=40916&r2=40917&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Constraint/ResourceMeasuresConsistency.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Constraint/ResourceMeasuresConsistency.py [utf8] Tue Nov 30 11:08:34 2010
@@ -57,6 +57,9 @@ class ResourceMeasuresConsistency(Constr
   def checkConsistency(self, obj, fixit=0):
     """Implement here the consistency checker
     """
+    if not self._checkConstraintCondition(obj):
+      return []
+
     error_list = []
     portal = obj.getPortalObject()
 

Modified: erp5/trunk/products/ERP5/Constraint/TradeModelLineCellConsistency.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Constraint/TradeModelLineCellConsistency.py?rev=40917&r1=40916&r2=40917&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Constraint/TradeModelLineCellConsistency.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Constraint/TradeModelLineCellConsistency.py [utf8] Tue Nov 30 11:08:34 2010
@@ -45,6 +45,9 @@ class TradeModelLineCellConsistency(Cons
     """
       Implement here the consistency checker
     """
+    if not self._checkConstraintCondition(document):
+      return []
+
     error_list = []
     base_id = self.constraint_definition['base_id']
     for cell_coordinates in document.getCellKeyList(base_id=base_id):

Modified: erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueFeasability.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueFeasability.py?rev=40917&r1=40916&r2=40917&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueFeasability.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueFeasability.py [utf8] Tue Nov 30 11:08:34 2010
@@ -39,6 +39,9 @@ class TransactionQuantityValueFeasabilit
       Check if the quantity of the transaction is possible
       for the source and the destination
       """
+      if not self._checkConstraintCondition(object):
+          return []
+
       errors = []
       source_cell = object.getSourceValue()
       destination_cell = object.getDestinationValue()

Modified: erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueValidity.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueValidity.py?rev=40917&r1=40916&r2=40917&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueValidity.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Constraint/TransactionQuantityValueValidity.py [utf8] Tue Nov 30 11:08:34 2010
@@ -38,6 +38,9 @@ class TransactionQuantityValueValidity(C
       Check if the quantity of the transaction is greater than the 
       balance of the source.
       """
+      if not self._checkConstraintCondition(object):
+        return []
+
       errors = []
 
       source_cell = object.getSourceValue()

Modified: erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py?rev=40917&r1=40916&r2=40917&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Constraint/PropertyTypeValidity.py [utf8] Tue Nov 30 11:08:34 2010
@@ -78,6 +78,9 @@ class PropertyTypeValidity(Constraint):
   def checkConsistency(self, obj, fixit=0):
     """Check the object's consistency.
     """
+    if not self._checkConstraintCondition(obj):
+      return []
+
     error_list = []
     # For each attribute name, we check type
     for prop in obj.propertyMap():



More information about the Erp5-report mailing list