[Erp5-report] r11660 - /erp5/trunk/products/ERP5OOo/Constraint/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 8 15:56:06 CET 2006


Author: bartek
Date: Fri Dec  8 15:56:05 2006
New Revision: 11660

URL: http://svn.erp5.org?rev=11660&view=rev
Log:
allow for adding custom constistency check from ZMI

Modified:
    erp5/trunk/products/ERP5OOo/Constraint/DocumentCoordinatesConstraint.py

Modified: erp5/trunk/products/ERP5OOo/Constraint/DocumentCoordinatesConstraint.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/Constraint/DocumentCoordinatesConstraint.py?rev=11660&r1=11659&r2=11660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/Constraint/DocumentCoordinatesConstraint.py (original)
+++ erp5/trunk/products/ERP5OOo/Constraint/DocumentCoordinatesConstraint.py Fri Dec  8 15:56:05 2006
@@ -42,6 +42,7 @@
   def checkConsistency(self, o, fixit=0, throw=False):
     """Implement here the consistency checker
     """
+    # XXX we probably could check reference syntax here, based on regexp in preferences?
     errors = []
 
     for req in ('reference', 'language', 'version'):
@@ -60,6 +61,10 @@
     if len(res)>2: # this is very serious
       raise Exception('Fatal error: multiple objects %s - %s - %s exist' % (o.getReference(),o.getLanguage(),o.getVersion()))
       #errors.append(self._generateError(o, N_(s)))
+    if hasattr(o,'Document_additionalConsistencyCheck'):
+      e=o.Document_additionalConsistencyCheck()
+      if e is not None and e!='':
+        errors.append(self._generateError(o, N_(e)))
     if errors and throw:
       raise Exception(str(errors))
     return errors




More information about the Erp5-report mailing list