diff --git a/product/ERP5Type/Constraint/AttributeEquality.py b/product/ERP5Type/Constraint/AttributeEquality.py index 2f133b0706d3824ec0f54255358c064bb23c17da..0134d1c3141f2e89e5925015426a2c56e698533a 100644 --- a/product/ERP5Type/Constraint/AttributeEquality.py +++ b/product/ERP5Type/Constraint/AttributeEquality.py @@ -51,9 +51,7 @@ class AttributeEquality(PropertyExistence): "value is ${current_value} but should be ${expected_value} (Fixed)" def checkConsistency(self, obj, fixit=0): - """ - This is the check method, we return a list of string, - each string corresponds to an error. + """Check the object's consistency. We will make sure that each non None constraint_definition is satisfied (equality) """ diff --git a/product/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py b/product/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py index 0b4e9120d256defdff88dea601eaf74145196c3a..653672b584b130a6790c5b94b1db5db299c9a0e1 100644 --- a/product/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py +++ b/product/ERP5Type/Constraint/CategoryAcquiredMembershipArity.py @@ -33,10 +33,10 @@ from Products.ERP5Type.Constraint.CategoryMembershipArity \ class CategoryAcquiredMembershipArity(CategoryMembershipArity): """ - This method check and fix if an object respects the arity. - For example we can check if every Order has at - least one source. - Configuration exemple: + This method checks if an object respects the arity. + + For example we can check if every Order has at least one source. + Configuration example: { 'id' : 'source', 'description' : '', 'type' : 'CategoryAcquiredMembershipArity', diff --git a/product/ERP5Type/Constraint/CategoryExistence.py b/product/ERP5Type/Constraint/CategoryExistence.py index e57e03cf79fe154f8ccfd1876b1026cd401d0354..1cfd982267171ce279e3b5772e995f599fafc5b9 100644 --- a/product/ERP5Type/Constraint/CategoryExistence.py +++ b/product/ERP5Type/Constraint/CategoryExistence.py @@ -56,9 +56,7 @@ class CategoryExistence(Constraint): portal_type=portal_type)) def checkConsistency(self, obj, fixit=0): - """ - This is the check method, we return a list of string, - each string corresponds to an error. + """Check the object's consistency. """ if not self._checkConstraintCondition(obj): return [] @@ -85,8 +83,8 @@ class CategoryExistence(Constraint): class CategoryAcquiredExistence(CategoryExistence): - """This constraint check an object respects the existence of a category, with - acquisition. + """This constraint checks if an object respects the existence of a category, + with acquisition. Configuration example: { 'id' : 'category_existence', diff --git a/product/ERP5Type/Constraint/CategoryMembershipArity.py b/product/ERP5Type/Constraint/CategoryMembershipArity.py index 9af25258a61879d1772bee07c73513fe316c84a6..fb04d1ed3ed217efb4c44d3ae617e74eb47bfc9a 100644 --- a/product/ERP5Type/Constraint/CategoryMembershipArity.py +++ b/product/ERP5Type/Constraint/CategoryMembershipArity.py @@ -31,9 +31,9 @@ from Constraint import Constraint class CategoryMembershipArity(Constraint): """ - This method check and fix if an object respects the arity. - For example we can check if every Order has at - least one source. + This constraint checks if an object respects the arity. + + For example we can check if every Order has at least one source. Configuration exemple: { 'id' : 'source', 'description' : '', @@ -45,6 +45,7 @@ class CategoryMembershipArity(Constraint): 'condition' : 'python: object.getPortalType() == 'Foo', }, """ + _message_id_list = ['message_arity_too_small', 'message_arity_not_in_range', 'message_arity_with_portal_type_to_small', @@ -73,9 +74,7 @@ class CategoryMembershipArity(Constraint): portal_type=portal_type)) def checkConsistency(self, obj, fixit=0): - """ - This is the check method, we return a list of string, - each string corresponds to an error. + """Check the object's consistency. We are looking the definition of the constraing where are defined the minimum and the maximum arity, and the list of objects we wants to check the arity. diff --git a/product/ERP5Type/Constraint/CategoryMembershipState.py b/product/ERP5Type/Constraint/CategoryMembershipState.py index 0abf3f740a3fbf83a70b473f3bf436be925a7a32..8f45e25c688d644b6ac59cd791bcb9a20db938da 100644 --- a/product/ERP5Type/Constraint/CategoryMembershipState.py +++ b/product/ERP5Type/Constraint/CategoryMembershipState.py @@ -51,12 +51,7 @@ class CategoryMembershipState(Constraint): "which is not in ${valid_state_list}" def checkConsistency(self, obj, fixit=0): - """ - This is the check method, we return a list of string, - each string corresponds to an error. - We are looking the definition of the constraing where - are defined the minimum and the maximum arity, and the - list of objects we wants to check the arity. + """Check the object's consistency. """ if not self._checkConstraintCondition(obj): return [] @@ -64,7 +59,7 @@ class CategoryMembershipState(Constraint): # Retrieve values inside de PropertySheet (_constraints) base_category = self.constraint_definition['base_category'] portal_type = self.constraint_definition['portal_type'] - membership_list = obj.getValueList(base_category, + membership_list = obj.getValueList(base_category, portal_type=portal_type) state_var_list = self.constraint_definition.copy() state_var_list.pop('portal_type') diff --git a/product/ERP5Type/Constraint/CategoryRelatedMembershipArity.py b/product/ERP5Type/Constraint/CategoryRelatedMembershipArity.py index 6e8cdaae6749e40b85445a80fd157422050c4bcf..f0d99d4de4681cc028acdd97ae91a4b7d1976342 100644 --- a/product/ERP5Type/Constraint/CategoryRelatedMembershipArity.py +++ b/product/ERP5Type/Constraint/CategoryRelatedMembershipArity.py @@ -33,8 +33,9 @@ from Products.ERP5Type.Constraint.CategoryMembershipArity \ class CategoryRelatedMembershipArity(CategoryMembershipArity): """ - This method check and fix if an object respects the arity - from a category reverse membership point of view. + This method checks if an object respects the arity from a category reverse + membership point of view. + For example we can check if every Order has at most one Order Applied Rule. Configuration example: diff --git a/product/ERP5Type/Constraint/PortalTypeClass.py b/product/ERP5Type/Constraint/PortalTypeClass.py index f1eedea2dbd9c40d761668f85e64cfcaf71d6f35..1c47cc69512cdd0d8c49ba2de58a6215691208bd 100644 --- a/product/ERP5Type/Constraint/PortalTypeClass.py +++ b/product/ERP5Type/Constraint/PortalTypeClass.py @@ -61,9 +61,7 @@ class PortalTypeClass(Constraint): " document class is ${document_class}" def checkConsistency(self, obj, fixit=0): - """ - This is the check method, we return a list of string, - each string corresponds to an error. + """Check the object's consistency. """ if not self._checkConstraintCondition(obj): return [] diff --git a/product/ERP5Type/Constraint/PropertyExistence.py b/product/ERP5Type/Constraint/PropertyExistence.py index c88af8dba72564eec44b74341409024fcb617c8d..65140060d0e086551024e08bd755c90a186e3bcd 100644 --- a/product/ERP5Type/Constraint/PropertyExistence.py +++ b/product/ERP5Type/Constraint/PropertyExistence.py @@ -31,8 +31,8 @@ from Constraint import Constraint class PropertyExistence(Constraint): """ - This method check and fix if an object respects the existence of a - property. + This method checks if an object respects the existence of a property. + For example we can check if every invoice line has a price defined on it. Configuration example: @@ -52,9 +52,7 @@ class PropertyExistence(Constraint): "${property_id}, this property is not defined" def checkConsistency(self, obj, fixit=0): - """ - This is the check method, we return a list of string, - each string corresponds to an error. + """Check the object's consistency. """ if not self._checkConstraintCondition(obj): return [] diff --git a/product/ERP5Type/Constraint/PropertyTypeValidity.py b/product/ERP5Type/Constraint/PropertyTypeValidity.py index 031fdf8c24a514701e806d3f57cb765a8da5024d..103a335676a3c97b6a28e5cc656e15195b4fd176 100644 --- a/product/ERP5Type/Constraint/PropertyTypeValidity.py +++ b/product/ERP5Type/Constraint/PropertyTypeValidity.py @@ -79,9 +79,7 @@ class PropertyTypeValidity(Constraint): def checkConsistency(self, obj, fixit=0): - """ - This is the check method, we return a list of string, - each string corresponds to an error. + """Check the object's consistency. """ error_list = [] # For each attribute name, we check type diff --git a/product/ERP5Type/Constraint/StringAttributeMatch.py b/product/ERP5Type/Constraint/StringAttributeMatch.py index e437f5f19e92cf2adebb2b59a33f888e445672ba..a0ff94b7b3cbeed07df1b3176e4e04dee5d5db90 100644 --- a/product/ERP5Type/Constraint/StringAttributeMatch.py +++ b/product/ERP5Type/Constraint/StringAttributeMatch.py @@ -31,9 +31,9 @@ from Products.ERP5Type.Constraint.PropertyExistence import PropertyExistence class StringAttributeMatch(PropertyExistence): """ - This constraint class allows to check - that a string property match a regular - expression. Configuration example: + This constraint class allows to check that a string property matches a + regular expression. + Configuration example: { 'id' : 'title_not_empty', 'description' : 'Title must be defined', 'type' : 'StringAttributeMatch', @@ -48,10 +48,8 @@ class StringAttributeMatch(PropertyExistence): "${attribute_value} and does not match ${regular_expression}." def checkConsistency(self, object, fixit=0): - """ - This is the check method, we return a list of string, - each string corresponds to an error. - Check that each attribute does not match the RE + """Check the object's consistency. + Check that each attribute matches the regular expression. """ error_list = PropertyExistence.checkConsistency( self, object, fixit=fixit) diff --git a/product/ERP5Type/Constraint/TALESConstraint.py b/product/ERP5Type/Constraint/TALESConstraint.py index b143eb5033675854500e917a17ed7ac4de8b82bc..e906602bd2b3c8a228f4536a48771d5f7344438d 100644 --- a/product/ERP5Type/Constraint/TALESConstraint.py +++ b/product/ERP5Type/Constraint/TALESConstraint.py @@ -59,7 +59,8 @@ class TALESConstraint(Constraint): "Error while evaluating expression: ${error_text}" def checkConsistency(self, obj, fixit=0): - """See Interface """ + """Check the object's consistency. + """ # import this later to prevent circular import from Products.ERP5Type.Utils import createExpressionContext if not self._checkConstraintCondition(obj):