diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml new file mode 100644 index 0000000000000000000000000000000000000000..f85c4b24db414ba2f5cfc450d7c4300f3a88900e --- /dev/null +++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml @@ -0,0 +1,187 @@ +<?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 encoding="cdata"><![CDATA[ + +# get the current logged user site\n +\n +from Products.ERP5Type.Cache import CachingMethod\n +\n +if user_id is None:\n + user_id = context.portal_membership.getAuthenticatedMember().getUserName()\n +\n +def getFunctionList(user_id=user_id):\n +\n + valid_assignment_list = context.Baobab_getUserAssignmentList(user_id=user_id)\n +\n + function_list = []\n + for a in valid_assignment_list:\n + new_function_list = a.getFunctionList()\n + if len(new_function_list)>0:\n + function_list.extend(new_function_list)\n + return function_list\n +\n +getFunctionList = CachingMethod(getFunctionList, id=\'Baobab_getUserAssignedFunctionList\', cache_duration=300)\n +return getFunctionList()\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>user_id=None</string> </value> + </item> + <item> + <key> <string>_proxy_roles</string> </key> + <value> + <tuple> + <string>Manager</string> + </tuple> + </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>1</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>user_id</string> + <string>Products.ERP5Type.Cache</string> + <string>CachingMethod</string> + <string>None</string> + <string>_getattr_</string> + <string>context</string> + <string>getFunctionList</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <tuple> + <none/> + </tuple> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Baobab_getUserAssignedFunctionList</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml index 9c07ff3447fe0b527adb7eca2a9894a976e38fd5..b3056571287565fb1586608203cf82ac32d2f34c 100644 --- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml +++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml @@ -70,14 +70,24 @@ <key> <string>_body</string> </key> <value> <string># get the current logged user site\n \n -valid_assignment_list = context.Baobab_getUserAssignmentList(user_id=user_id)\n +from Products.ERP5Type.Cache import CachingMethod\n \n -site_list = []\n -for a in valid_assignment_list:\n - new_site = a.getSite()\n - if new_site not in (\'\', None):\n - site_list.append(new_site)\n -return site_list\n +if user_id is None:\n + user_id = context.portal_membership.getAuthenticatedMember().getUserName()\n +\n +def getSiteList(user_id=user_id):\n +\n + valid_assignment_list = context.Baobab_getUserAssignmentList(user_id=user_id)\n +\n + site_list = []\n + for a in valid_assignment_list:\n + new_site = a.getSite()\n + if new_site not in (\'\', None):\n + site_list.append(new_site)\n + return site_list\n +\n +getSiteList = CachingMethod(getSiteList, id=\'Baobab_getUserAssignedSiteList\', cache_duration=300)\n +return getSiteList(user_id=user_id)\n </string> </value> </item> <item> @@ -135,14 +145,12 @@ return site_list\n <value> <tuple> <string>user_id</string> + <string>Products.ERP5Type.Cache</string> + <string>CachingMethod</string> + <string>None</string> <string>_getattr_</string> <string>context</string> - <string>valid_assignment_list</string> - <string>site_list</string> - <string>_getiter_</string> - <string>a</string> - <string>new_site</string> - <string>None</string> + <string>getSiteList</string> </tuple> </value> </item> diff --git a/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml b/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml index 6ff3f352dd1e396e253c4e2ff1b38f16339d6c06..c56bdc41536759525ded5ad9c3fd66807b961efb 100644 --- a/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml +++ b/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml @@ -76,6 +76,7 @@ <tuple> <string>Assignor</string> <string>Manager</string> + <string>Member</string> </tuple> </value> </item> @@ -94,6 +95,7 @@ <tuple> <string>Assignor</string> <string>Manager</string> + <string>Member</string> </tuple> </value> </item>