Commit 9cbc14e3 authored by Jérome Perrin's avatar Jérome Perrin

Use source_administration to set who is the assignee on a transmission sheet;
No need to use a Role Definition, security can be dynamically based on the source_administration information.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10872 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fa62d90c
<allowed_content_type_list> <allowed_content_type_list>
<portal_type id="Invoice Transmission Sheet">
<item>Role Definition</item>
</portal_type>
<portal_type id="Invoice Transmission Sheet Module"> <portal_type id="Invoice Transmission Sheet Module">
<item>Invoice Transmission Sheet</item> <item>Invoice Transmission Sheet</item>
</portal_type> </portal_type>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<portal_type id="Invoice Transmission Sheet"> <portal_type id="Invoice Transmission Sheet">
<item>PurchaseInvoiceTransmissionSheet</item> <item>PurchaseInvoiceTransmissionSheet</item>
<item>SortIndex</item> <item>SortIndex</item>
<item>Arrow</item>
<item>Task</item> <item>Task</item>
<item>DefaultRoleDefinition</item>
</portal_type> </portal_type>
</property_sheet_list> </property_sheet_list>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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>"""TODO"""\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</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/>
</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>InvoiceTransmissionSheet_assignLocalRoles</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -68,7 +68,11 @@ ...@@ -68,7 +68,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return [(pers.getTitle(), pers.getRelativeUrl())\n <value> <string>"""Returns an item list of all person we can affect this transmission sheet to.\n
This script returns all persons with internal roles, you can customize it according\n
to your security configuration (eg. using function)\n
"""\n
return [(pers.getTitle(), pers.getRelativeUrl())\n
for pers in context.getPortalObject().person_module.searchFolder(role_id="internal")]\n for pers in context.getPortalObject().person_module.searchFolder(role_id="internal")]\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -100,6 +100,8 @@ ...@@ -100,6 +100,8 @@
<value> <value>
<list> <list>
<string>listbox_total_price</string> <string>listbox_total_price</string>
<string>listbox_mirror_section_title</string>
<string>listbox_int_index</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -109,10 +111,8 @@ ...@@ -109,10 +111,8 @@
<list> <list>
<string>my_title</string> <string>my_title</string>
<string>my_description</string> <string>my_description</string>
<string>my_default_role_definition_agent_title</string>
<string>total_amount</string> <string>total_amount</string>
<string>listbox_mirror_section_title</string> <string>my_source_administration_title</string>
<string>listbox_int_index</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_default_role_definition_agent_title</string> </value> <value> <string>my_source_administration_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -68,14 +68,13 @@ ...@@ -68,14 +68,13 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""Add a local roles on this transmission sheet and all related invoices\n <value> <string>"""Affect this transmission sheet and all related invoices\n
"""\n """\n
transmission_sheet = sci[\'object\']\n transmission_sheet = sci[\'object\']\n
agent = sci[\'kwargs\'][\'agent\']\n agent = sci[\'kwargs\'][\'agent\']\n
portal = transmission_sheet.getPortalObject()\n portal = transmission_sheet.getPortalObject()\n
\n \n
transmission_sheet.setDefaultRoleDefinitionAgent(agent)\n transmission_sheet.setSourceAdministration(agent)\n
transmission_sheet.setDefaultRoleDefinitionRoleName(\'Assignee\')\n
transmission_sheet.updateLocalRolesOnSecurityGroups()\n transmission_sheet.updateLocalRolesOnSecurityGroups()\n
\n \n
for invoice in transmission_sheet.getAggregateRelatedValueList(\n for invoice in transmission_sheet.getAggregateRelatedValueList(\n
......
30 31
\ No newline at end of file \ No newline at end of file
Invoice Transmission Sheet Module | Invoice Transmission Sheet Invoice Transmission Sheet Module | Invoice Transmission Sheet
Invoice Transmission Sheet | Role Definition
\ No newline at end of file
Account | M9Account Account | M9Account
Invoice Transmission Sheet | DefaultRoleDefinition Invoice Transmission Sheet | Arrow
Invoice Transmission Sheet | PurchaseInvoiceTransmissionSheet Invoice Transmission Sheet | PurchaseInvoiceTransmissionSheet
Invoice Transmission Sheet | SortIndex Invoice Transmission Sheet | SortIndex
Invoice Transmission Sheet | Task Invoice Transmission Sheet | Task
\ 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