Commit 15cb7870 authored by Benjamin Blanc's avatar Benjamin Blanc

erp5_scalability_data: Add script to clone 1000 scalability users

parent 661e6d02
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
module = context.person_module\n
my_user = module.scalability_user\n
\n
for i in xrange(0,1000):\n
new_user = my_user.Base_createCloneDocument(batch_mode=1)\n
name = \'scalability_user_%d\' %i\n
new_user.setId(name)\n
new_user.setTitle(name)\n
new_user.setReference(name)\n
# new_user.setSubordinationValue(some_organisation_document)\n
new_user.validate()\n
assignment = new_user.objectValues(portal_type=\'Assignment\')[0]\n
assignment.open()\n
return 1\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>clone_scalability_user</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
7 8
\ No newline at end of file \ No newline at end of file
portal_skins/custom/clone_scalability_user
organisation_module/idexen organisation_module/idexen
organisation_module/idexen/** organisation_module/idexen/**
person_module/scalability_user person_module/scalability_user
......
...@@ -8,6 +8,7 @@ person_module/john_rock ...@@ -8,6 +8,7 @@ person_module/john_rock
person_module/john_rock/* person_module/john_rock/*
person_module/scalability_user person_module/scalability_user
person_module/scalability_user/* person_module/scalability_user/*
portal_skins/custom/clone_scalability_user
product_module/blue_led product_module/blue_led
product_module/blue_led/* product_module/blue_led/*
product_module/green_led product_module/green_led
......
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