Commit aab49d81 authored by Jérome Perrin's avatar Jérome Perrin

- Add a script to list possible role name on a role definition

- Use person module's listbox in role definition "agent" relation field

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24752 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8d4486bb
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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>from Products.ERP5Type.Message import translateString\n
item_list = [(\'\', \'\')]\n
\n
for role in context.valid_roles():\n
if role not in (\'Owner\', \'Manager\', \'Assignor\',):\n
item_list.append((translateString(role), role))\n
\n
return item_list\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>Products.ERP5Type.Message</string>
<string>translateString</string>
<string>item_list</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>role</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>RoleDefinition_getRoleNameItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -19,6 +19,7 @@
<string>portal_type</string>
<string>allow_creation</string>
<string>catalog_index</string>
<string>proxy_listbox_ids</string>
</list>
</value>
</item>
......@@ -119,10 +120,6 @@
<key> <string>description</string> </key>
<value> <string>The agents.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_multi_relation_field</string> </value>
......@@ -142,6 +139,17 @@
</list>
</value>
</item>
<item>
<key> <string>proxy_listbox_ids</string> </key>
<value>
<list>
<tuple>
<string>PersonModule_viewPersonList/listbox</string>
<string>Persons</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
......
......@@ -125,18 +125,15 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [r for r in here.valid_roles() if r not in(\'Owner\',\'Manager\',\'Assignor\')]</string> </value>
<value> <string>here/RoleDefinition_getRoleNameItemList</string> </value>
</item>
</dictionary>
</pickle>
......
479
\ No newline at end of file
480
\ 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