[Erp5-report] r44956 rafael - in /erp5/trunk/bt5/erp5_configurator_maxma_demo: SkinTemplate...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 1 01:18:47 CEST 2011


Author: rafael
Date: Fri Apr  1 01:18:46 2011
New Revision: 44956

URL: http://svn.erp5.org?rev=44956&view=rev
Log:
Update local roles from all objects introduced by this business erp5_demo_maxma_sample

Modified:
    erp5/trunk/bt5/erp5_configurator_maxma_demo/SkinTemplateItem/portal_skins/erp5_configurator_maxma_demo/BusinessConfiguration_afterMaxmaDemoConfiguration.xml
    erp5/trunk/bt5/erp5_configurator_maxma_demo/bt/revision

Modified: erp5/trunk/bt5/erp5_configurator_maxma_demo/SkinTemplateItem/portal_skins/erp5_configurator_maxma_demo/BusinessConfiguration_afterMaxmaDemoConfiguration.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_configurator_maxma_demo/SkinTemplateItem/portal_skins/erp5_configurator_maxma_demo/BusinessConfiguration_afterMaxmaDemoConfiguration.xml?rev=44956&r1=44955&r2=44956&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_configurator_maxma_demo/SkinTemplateItem/portal_skins/erp5_configurator_maxma_demo/BusinessConfiguration_afterMaxmaDemoConfiguration.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_configurator_maxma_demo/SkinTemplateItem/portal_skins/erp5_configurator_maxma_demo/BusinessConfiguration_afterMaxmaDemoConfiguration.xml [utf8] Fri Apr  1 01:18:46 2011
@@ -56,55 +56,12 @@ from Products.ERP5Type.Log import log\n
 \n
 portal = context.getPortalObject()\n
 portal_preferences = portal.portal_preferences\n
-business_template = context.portal_templates.getInstalledBusinessTemplate("erp5_demo_maxma_sample")\n
+bt = context.portal_templates.getInstalledBusinessTemplate("erp5_demo_maxma_sample")\n
 N_ = context.Base_translateString\n
 isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
 \n
-if business_template is not None:\n
-  # update role settings for modules which exists already\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
-      module.updateLocalRolesOnSecurityGroups()\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 business_template.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
-      obj.updateLocalRolesOnSecurityGroups()\n
-      print "Updated Role Mappings for: ", path, obj.getPortalType()\n
-\n
-  # validate and open all objects\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\',\n
-                                 \'Organisation\',\n
-                                 \'Business Process\',\n
-                                 \'Account\',\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
-\n
-        for period in obj.contentValues(filter={\'portal_type\':\'Accounting Period\'}):\n
-            period.updateLocalRolesOnSecurityGroups()\n
-            print "\\tOpen (Accounting Period): ", period.getRelativeUrl()\n
-\n
-        for assignment in obj.contentValues(filter={\'portal_type\':\'Assignment\'}):\n
-            assignment.updateLocalRolesOnSecurityGroups()\n
-            print "\\tOpen (assignment): ", assignment.getRelativeUrl()\n
+for obj in context.portal_catalog(path=["%%/%s" % i.replace("**", "%") for i in bt.getTemplatePathList()]):\n
+  obj.activate().updateLocalRolesOnSecurityGroups()\n
 \n
 for gadget in context.portal_gadgets.objectValues():\n
   if gadget.getValidationState() == \'invisible\':\n

Modified: erp5/trunk/bt5/erp5_configurator_maxma_demo/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_configurator_maxma_demo/bt/revision?rev=44956&r1=44955&r2=44956&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_configurator_maxma_demo/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_configurator_maxma_demo/bt/revision [utf8] Fri Apr  1 01:18:46 2011
@@ -1 +1 @@
-15
\ No newline at end of file
+16
\ No newline at end of file



More information about the Erp5-report mailing list