[Erp5-report] r42131 rafael - in /erp5/trunk/bt5/erp5_configurator_standard: SkinTemplateIt...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 7 19:18:13 CET 2011


Author: rafael
Date: Fri Jan  7 19:18:13 2011
New Revision: 42131

URL: http://svn.erp5.org?rev=42131&view=rev
Log:
Remove parameters and add comments.

Modified:
    erp5/trunk/bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_afterConfiguration.xml
    erp5/trunk/bt5/erp5_configurator_standard/bt/revision

Modified: erp5/trunk/bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_afterConfiguration.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_afterConfiguration.xml?rev=42131&r1=42130&r2=42131&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_afterConfiguration.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_configurator_standard/SkinTemplateItem/portal_skins/erp5_configurator_standard/BusinessConfiguration_afterConfiguration.xml [utf8] Fri Jan  7 19:18:13 2011
@@ -56,8 +56,7 @@ from Products.ERP5Type.Log import log\n
 \n
 portal = context.getPortalObject()\n
 portal_preferences = portal.portal_preferences\n
-bt5_obj = portal.restrictedTraverse(customer_template_relative_url)\n
-username = str(getSecurityManager().getUser())\n
+business_template = context.getSpecialiseValue()\n
 N_ = context.Base_translateString\n
 isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
 \n
@@ -65,6 +64,8 @@ isTransitionPossible = portal.portal_wor
 # all needed preferences are configured by Configurator\n
 # disable the default configurator system preference \n
 # that comes when instance is delivered\n
+# XXX Rafael: Is this still TRUE? it is not safe (or good)\n
+# disable people preferences after setted.\n
 preference_to_disable_list = [\'default_site_preference\', \n
                               \'default_initial_configurator_system_preference\']\n
 \n
@@ -74,9 +75,9 @@ for preference_to_disable in preference_
     if isTransitionPossible(preference, \'disable\'):\n
       preference.disable()\n
 \n
-if bt5_obj is not None:\n
+if business_template is not None:\n
   # update role settings for modules which exists already\n
-  for portal_type in bt5_obj.getTemplatePortalTypeRolesList():\n
+  for portal_type in business_template.getTemplatePortalTypeRolesList():\n
     module_list = portal.contentValues(\n
                     filter=dict(portal_type=portal_type))\n
     for module in module_list:\n
@@ -84,7 +85,7 @@ if bt5_obj is not None:\n
       print "Updated Role Mappings for: %s(%s) " %(module.getTitle(), module.getPortalType())\n
 \n
   # update path items. FIXME: local roles should be exported by business template instead\n
-  for path in bt5_obj.getTemplatePathList():\n
+  for path in business_templates.getTemplatePathList():\n
     obj = portal.restrictedTraverse(path, None)\n
     # no need to update security on categories\n
     if obj is not None and obj.getPortalType() not in (\'Category\', \'Base Category\',):\n
@@ -92,16 +93,27 @@ if bt5_obj is not None:\n
       print "Updated Role Mappings for: ", path, obj.getPortalType()\n
 \n
   # validate and open all objects\n
-  for path in bt5_obj.getTemplatePathList():\n
+  for path in business_template.getTemplatePathList():\n
     obj = context.getPortalObject().restrictedTraverse(path, None)\n
     if obj is not None and hasattr(obj, \'getPortalType\'):\n
-      if obj.getPortalType() in (\'Person\', \'Organisation\', \'Account\', \'Tax\',\n
-                                 \'Discount\', \'Service\', \'Product\',\n
-                                 \'Sale Trade Condition\', \'Purchase Trade Condition\',\n
-                                 \'Order Root Simulation Rule\', \'Delivery Root Simulation Rule\',\n
-                                 \'Trade Model Simulation Rule\', \'Accounting Transaction Root Simulation Rule\',\n
-                                 \'Invoice Transaction Simulation Rule\', \'Payment Simulation Rule\',\n
-                                 \'Invoice Root Simulation Rule\', \'Delivery Simulation Rule\', \'Invoice Simulation Rule\'):\n
+      # XXX This hardcoded list is a bit inconvinient.\n
+      if obj.getPortalType() in (\'Person\', \n
+                                 \'Organisation\', \n
+                                 \'Account\', \n
+                                 \'Tax\',\n
+                                 \'Discount\', \n
+                                 \'Service\', \'Product\',\n
+                                 \'Sale Trade Condition\', \n
+                                 \'Purchase Trade Condition\',\n
+                                 \'Order Root Simulation Rule\', \n
+                                 \'Delivery Root Simulation Rule\',\n
+                                 \'Trade Model Simulation Rule\', \n
+                                 \'Accounting Transaction Root Simulation Rule\',\n
+                                 \'Invoice Transaction Simulation Rule\', \n
+                                 \'Payment Simulation Rule\',\n
+                                 \'Invoice Root Simulation Rule\', \n
+                                 \'Delivery Simulation Rule\', \n
+                                 \'Invoice Simulation Rule\'):\n
         if isTransitionPossible(obj, \'validate\'):\n
           obj.validate()\n
           print "Validated: ", obj.getRelativeUrl()\n
@@ -118,6 +130,7 @@ if bt5_obj is not None:\n
             print "\\tOpen (assignment): ", assignment.getRelativeUrl()\n
 \n
   # XXX: We do not care about gadgets now\n
+  # This should be a Configurator Item Instead.\n
   #portal.ERP5Site_setupGadget()\n
 \n
 # update security settings for default preference # XXX why ???\n
@@ -127,6 +140,9 @@ if default_configurator_preference is no
   default_configurator_preference.updateLocalRolesOnSecurityGroups()\n
 \n
 # set manually in \'Module Properties\' respective business_application category\n
+# XXX This should be part of Configuration Item probably, but as access_tab is\n
+# going to be deprecated, make sure it still requires set business application\n
+# info modules.\n
 module_business_application_map = {\'base\': (\'currency_module\',\n
                                             \'organisation_module\',\n
                                             \'person_module\',),\n
@@ -178,7 +194,7 @@ log("%s" % printed)\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>customer_template_relative_url=None, alter_preferences=True</string> </value>
+            <value> <string>alter_preferences=True</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>

Modified: erp5/trunk/bt5/erp5_configurator_standard/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_configurator_standard/bt/revision?rev=42131&r1=42130&r2=42131&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_configurator_standard/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_configurator_standard/bt/revision [utf8] Fri Jan  7 19:18:13 2011
@@ -1 +1 @@
-557
\ No newline at end of file
+558
\ No newline at end of file



More information about the Erp5-report mailing list