diff --git a/product/ERP5/Constraint/AccountTypeConstraint.py b/product/ERP5/Constraint/AccountTypeConstraint.py index 3046587aa0df5461ec9997cbd747805e8cf0c938..1a0d3a8d952bbe3d7ba907b25adb3eb5def1662e 100644 --- a/product/ERP5/Constraint/AccountTypeConstraint.py +++ b/product/ERP5/Constraint/AccountTypeConstraint.py @@ -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( diff --git a/product/ERP5/Constraint/BudgetConsumptionFeasability.py b/product/ERP5/Constraint/BudgetConsumptionFeasability.py index 585a76f06db51386c9b318a5e27c5e285b1e3086..83b07753ff777a6c1d2cb41c68e8d187a6d47591 100644 --- a/product/ERP5/Constraint/BudgetConsumptionFeasability.py +++ b/product/ERP5/Constraint/BudgetConsumptionFeasability.py @@ -37,6 +37,9 @@ class BudgetConsumptionFeasability(Constraint): """ Check if there is enough budget to consumed. """ + if not self._checkConstraintCondition(object): + return [] + errors = [] new_category_list = [] diff --git a/product/ERP5/Constraint/DocumentReferenceConstraint.py b/product/ERP5/Constraint/DocumentReferenceConstraint.py index 2c6fd9acfe7bfc5a612b249fe529de0d208c7656..f3d9e234f72a25ea81b077139d9251afea5ad390 100644 --- a/product/ERP5/Constraint/DocumentReferenceConstraint.py +++ b/product/ERP5/Constraint/DocumentReferenceConstraint.py @@ -58,6 +58,9 @@ class DocumentReferenceConstraint(Constraint): """ 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 = [] diff --git a/product/ERP5/Constraint/ResourceMeasuresConsistency.py b/product/ERP5/Constraint/ResourceMeasuresConsistency.py index 0ab3400bb277ab3edcc447e2a23f8813648ee421..4506cbb265fc593fb039d2c23d969cd88a353c6f 100644 --- a/product/ERP5/Constraint/ResourceMeasuresConsistency.py +++ b/product/ERP5/Constraint/ResourceMeasuresConsistency.py @@ -57,6 +57,9 @@ class ResourceMeasuresConsistency(Constraint): def checkConsistency(self, obj, fixit=0): """Implement here the consistency checker """ + if not self._checkConstraintCondition(obj): + return [] + error_list = [] portal = obj.getPortalObject() diff --git a/product/ERP5/Constraint/TradeModelLineCellConsistency.py b/product/ERP5/Constraint/TradeModelLineCellConsistency.py index 6c5754a2a6b6c6dd6901582158db9b3d157fecdc..08da757e2d9ff1c4a137eb9a668b930c92bb543e 100644 --- a/product/ERP5/Constraint/TradeModelLineCellConsistency.py +++ b/product/ERP5/Constraint/TradeModelLineCellConsistency.py @@ -45,6 +45,9 @@ class TradeModelLineCellConsistency(Constraint): """ 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): diff --git a/product/ERP5/Constraint/TransactionQuantityValueFeasability.py b/product/ERP5/Constraint/TransactionQuantityValueFeasability.py index de338fc7b3a97cdb2931757b41f56b94d6ddc491..840bbc00ce6a1f4baf040acd050f9d3ba0742874 100644 --- a/product/ERP5/Constraint/TransactionQuantityValueFeasability.py +++ b/product/ERP5/Constraint/TransactionQuantityValueFeasability.py @@ -39,6 +39,9 @@ class TransactionQuantityValueFeasability(Constraint): 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() diff --git a/product/ERP5/Constraint/TransactionQuantityValueValidity.py b/product/ERP5/Constraint/TransactionQuantityValueValidity.py index 2a23859f2a23813fb23f08f839d1c3285d5b83f8..d2d62fb60e353c3b3afe23a2e7fe2d3b39698fef 100644 --- a/product/ERP5/Constraint/TransactionQuantityValueValidity.py +++ b/product/ERP5/Constraint/TransactionQuantityValueValidity.py @@ -38,6 +38,9 @@ class TransactionQuantityValueValidity(Constraint): 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() diff --git a/product/ERP5Type/Constraint/PropertyTypeValidity.py b/product/ERP5Type/Constraint/PropertyTypeValidity.py index b936989aeaf0a0682e994966691e23659268a278..5c49d17ed15065365cbc7a7715926376d29b08f7 100644 --- a/product/ERP5Type/Constraint/PropertyTypeValidity.py +++ b/product/ERP5Type/Constraint/PropertyTypeValidity.py @@ -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():