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
\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_workflow.isTransitionPossible\n
# 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_to_disable_list:\n
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 not None:\n
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>
......
557
\ No newline at end of file
558
\ 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