[Erp5-report] r16022 - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Sep 3 16:35:49 CEST 2007


Author: nicolas
Date: Mon Sep  3 16:35:49 2007
New Revision: 16022

URL: http://svn.erp5.org?rev=16022&view=rev
Log:
Use type base method to extend property_dict

Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=16022&r1=16021&r2=16022&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Mon Sep  3 16:35:49 2007
@@ -2192,9 +2192,8 @@
   def getIdTranslationDict(self):
     """Returns the mapping which is used to translate IDs.
     """
-    return {
-        'Address': dict(default_address='Default Address',
-                        head_quarter_address='Head Quarter Address'),
+    property_dict = {
+        'Address': dict(default_address='Default Address'),
         'Telephone': dict(default_telephone='Default Telephone',
                           mobile_telephone='Mobile Telephone',),
         'Fax': dict(default_fax='Default Fax'),
@@ -2209,6 +2208,16 @@
         'Sale Supply Line': dict(sale_supply_line=
                                  'Default Sale Supply Line'),
     }
+    method = self._getTypeBasedMethod('getIdTranslationDict',
+        fallback_script_id = 'Base_getIdTranslationDict')
+    if method is not None:
+      user_dict = method()
+      for k in user_dict.keys():
+        if property_dict.get(k, None) is not None:
+          property_dict[k].update(user_dict[k])
+        else:
+          property_dict.update(user_dict)
+    return property_dict
 
 
   security.declareProtected(Permissions.AccessContentsInformation,




More information about the Erp5-report mailing list