[Erp5-report] r32250 rafael - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 4 09:39:43 CET 2010


Author: rafael
Date: Thu Feb  4 09:39:41 2010
New Revision: 32250

URL: http://svn.erp5.org?rev=32250&view=rev
Log:
Introduced a new method. This Type Name Definition is used everywhere in this file, very hard to guess the meaning in others places. This method should centralize the definition in one place. This file will be be updated to use this method instead local definition everywhere.

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=32250&r1=32249&r2=32250&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Thu Feb  4 09:39:41 2010
@@ -586,6 +586,15 @@
     elif meta_type == 'Script (Python)':
       obj._code = None
     return obj
+
+  def getTemplateTypeName(self):
+    """
+     Get a meaningfull class Name without 'TemplateItem'. Used to 
+     present to the user.
+
+     XXX: -12 used here is -len('TemplateItem')
+    """
+    return self.__class__.__name__[:-12]
 
 class ObjectTemplateItem(BaseTemplateItem):
   """




More information about the Erp5-report mailing list