Commit 2baf4580 authored by Rafael Monnerat's avatar Rafael Monnerat

Remove parameters and add comments.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42131 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 51e2467a
...@@ -56,8 +56,7 @@ from Products.ERP5Type.Log import log\n ...@@ -56,8 +56,7 @@ from Products.ERP5Type.Log import log\n
\n \n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
portal_preferences = portal.portal_preferences\n portal_preferences = portal.portal_preferences\n
bt5_obj = portal.restrictedTraverse(customer_template_relative_url)\n business_template = context.getSpecialiseValue()\n
username = str(getSecurityManager().getUser())\n
N_ = context.Base_translateString\n N_ = context.Base_translateString\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
\n \n
...@@ -65,6 +64,8 @@ isTransitionPossible = portal.portal_workflow.isTransitionPossible\n ...@@ -65,6 +64,8 @@ isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
# all needed preferences are configured by Configurator\n # all needed preferences are configured by Configurator\n
# disable the default configurator system preference \n # disable the default configurator system preference \n
# that comes when instance is delivered\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 preference_to_disable_list = [\'default_site_preference\', \n
\'default_initial_configurator_system_preference\']\n \'default_initial_configurator_system_preference\']\n
\n \n
...@@ -74,9 +75,9 @@ for preference_to_disable in preference_to_disable_list:\n ...@@ -74,9 +75,9 @@ for preference_to_disable in preference_to_disable_list:\n
if isTransitionPossible(preference, \'disable\'):\n if isTransitionPossible(preference, \'disable\'):\n
preference.disable()\n preference.disable()\n
\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 # 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 module_list = portal.contentValues(\n
filter=dict(portal_type=portal_type))\n filter=dict(portal_type=portal_type))\n
for module in module_list:\n for module in module_list:\n
...@@ -84,7 +85,7 @@ if bt5_obj is not None:\n ...@@ -84,7 +85,7 @@ if bt5_obj is not None:\n
print "Updated Role Mappings for: %s(%s) " %(module.getTitle(), module.getPortalType())\n print "Updated Role Mappings for: %s(%s) " %(module.getTitle(), module.getPortalType())\n
\n \n
# update path items. FIXME: local roles should be exported by business template instead\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 obj = portal.restrictedTraverse(path, None)\n
# no need to update security on categories\n # no need to update security on categories\n
if obj is not None and obj.getPortalType() not in (\'Category\', \'Base Category\',):\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 ...@@ -92,16 +93,27 @@ if bt5_obj is not None:\n
print "Updated Role Mappings for: ", path, obj.getPortalType()\n print "Updated Role Mappings for: ", path, obj.getPortalType()\n
\n \n
# validate and open all objects\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 obj = context.getPortalObject().restrictedTraverse(path, None)\n
if obj is not None and hasattr(obj, \'getPortalType\'):\n if obj is not None and hasattr(obj, \'getPortalType\'):\n
if obj.getPortalType() in (\'Person\', \'Organisation\', \'Account\', \'Tax\',\n # XXX This hardcoded list is a bit inconvinient.\n
\'Discount\', \'Service\', \'Product\',\n if obj.getPortalType() in (\'Person\', \n
\'Sale Trade Condition\', \'Purchase Trade Condition\',\n \'Organisation\', \n
\'Order Root Simulation Rule\', \'Delivery Root Simulation Rule\',\n \'Account\', \n
\'Trade Model Simulation Rule\', \'Accounting Transaction Root Simulation Rule\',\n \'Tax\',\n
\'Invoice Transaction Simulation Rule\', \'Payment Simulation Rule\',\n \'Discount\', \n
\'Invoice Root Simulation Rule\', \'Delivery Simulation Rule\', \'Invoice Simulation Rule\'):\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 if isTransitionPossible(obj, \'validate\'):\n
obj.validate()\n obj.validate()\n
print "Validated: ", obj.getRelativeUrl()\n print "Validated: ", obj.getRelativeUrl()\n
...@@ -118,6 +130,7 @@ if bt5_obj is not None:\n ...@@ -118,6 +130,7 @@ if bt5_obj is not None:\n
print "\\tOpen (assignment): ", assignment.getRelativeUrl()\n print "\\tOpen (assignment): ", assignment.getRelativeUrl()\n
\n \n
# XXX: We do not care about gadgets now\n # XXX: We do not care about gadgets now\n
# This should be a Configurator Item Instead.\n
#portal.ERP5Site_setupGadget()\n #portal.ERP5Site_setupGadget()\n
\n \n
# update security settings for default preference # XXX why ???\n # update security settings for default preference # XXX why ???\n
...@@ -127,6 +140,9 @@ if default_configurator_preference is not None:\n ...@@ -127,6 +140,9 @@ if default_configurator_preference is not None:\n
default_configurator_preference.updateLocalRolesOnSecurityGroups()\n default_configurator_preference.updateLocalRolesOnSecurityGroups()\n
\n \n
# set manually in \'Module Properties\' respective business_application category\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 module_business_application_map = {\'base\': (\'currency_module\',\n
\'organisation_module\',\n \'organisation_module\',\n
\'person_module\',),\n \'person_module\',),\n
...@@ -178,7 +194,7 @@ log("%s" % printed)\n ...@@ -178,7 +194,7 @@ log("%s" % printed)\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <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>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
557 558
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment