[Erp5-report] r18365 - /erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Dec 17 17:21:53 CET 2007


Author: jerome
Date: Mon Dec 17 17:21:52 2007
New Revision: 18365

URL: http://svn.erp5.org?rev=18365&view=rev
Log:
use new style user configurable messages.

Modified:
    erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py

Modified: erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py?rev=18365&r1=18364&r2=18365&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py (original)
+++ erp5/trunk/products/ERP5/Constraint/AccountTypeConstraint.py Mon Dec 17 17:21:52 2007
@@ -28,7 +28,7 @@
 
 from Products.ERP5Type.Constraint import Constraint
 from Products.ERP5Type.Message import Message
-N_ = lambda msg: msg
+N_ = lambda msg: msg  # just to extract messages
 _MARKER = []
 
 class AccountTypeConstraint(Constraint):
@@ -50,6 +50,12 @@
 
   This constraints supports fixing consistency.
   """
+  
+  _message_id_list = ['message_inconsistent_account_type']
+  
+  message_inconsistent_account_type = N_('Account is member'\
+      ' of ${category}, this should have account_type'\
+      ' in ${account_type_list}')
 
   def checkConsistency(self, obj, fixit=0):
     """Implement here the consistency checker
@@ -68,8 +74,7 @@
         if obj.isMemberOf(category):
           if obj.getAccountType() not in account_type_list:
             errors.append(self._generateError(obj,
-                N_("Account is member of ${category}, thus should have"
-                   " account_type in ${account_type_list}"),
+                self._getMessage('message_inconsistent_account_type'),
                 # XXX we should probably print translated logical path of
                 # categories instead of category path.
                     mapping=dict(category=category,




More information about the Erp5-report mailing list