Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
10c59883
Commit
10c59883
authored
Aug 08, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_scalability_data: Fix updat roles scalability script
parent
5ea01b81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
bt5/erp5_scalability_data/PathTemplateItem/portal_skins/custom/update_roles_scalability.xml
...lateItem/portal_skins/custom/update_roles_scalability.xml
+27
-6
bt5/erp5_scalability_data/bt/revision
bt5/erp5_scalability_data/bt/revision
+1
-1
No files found.
bt5/erp5_scalability_data/PathTemplateItem/portal_skins/custom/update_roles_scalability.xml
View file @
10c59883
...
...
@@ -51,13 +51,34 @@
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
portal = context.getPortalObject()\n
portal_types = portal.searchFolder(title=\'portal_types\')[0]\n
role_name_list = [\'Assignor\', \'Assignee\', \'Associate\', \'Auditor\', \'Author\']\n
role_category_list = [\'group/my_group\']\n
\n
# Update roles of Product, Organisation and Sale Trade Condition\n
portal_type = portal.searchFolder(title=\'portal_types\')[0]\n
portal_type.searchFolder(title=\'Product\')[0].updateRoleMapping()\n
portal_type.searchFolder(title=\'Person\')[0].updateRoleMapping()\n
portal_type.searchFolder(title=\'Organisation\')[0].updateRoleMapping()\n
portal_type.searchFolder(title=\'Sale Trade Condition\')[0].updateRoleMapping()\n
role_list = [\'Product\', \'Product Module\', \'Person\', \'Person Module\', \n
\'Organisation\', \'Organisation Module\', \'Sale Trade Condition\',\n
\'Sale Trade Condition Module\', \'Web Page Module\', \'Sale Order Module\']\n
\n
\n
for role in role_list:\n
\n
# Get portal type\n
current_portal = portal_types.searchFolder(title={\'query\':role, \'key\':\'ExactMatch\'})[0]\n
\n
# Delete existing role informations\n
id_list = [x.getId() for x in current_portal.searchFolder(portal_type=\'Role Information\')]\n
current_portal.manage_delObjects(id_list)\n
\n
# Create new role information\n
current_portal.newContent(\n
portal_type = \'Role Information\',\n
title = \'Default\',\n
role_name_list = role_name_list,\n
role_category_list = role_category_list,\n
description = \'Configured by Scalability script\'\n
)\n
# Update roles\n
current_portal.updateRoleMapping()\n
\n
return 1\n
</string>
</value>
...
...
bt5/erp5_scalability_data/bt/revision
View file @
10c59883
21
\ No newline at end of file
22
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment