Commit 401669c8 authored by Aurel's avatar Aurel

fix destination/source script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14075 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6de56892
<?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>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>source = context.getSource()\n
if source is not None:\n
return source\n
# calculate the source\n
# must use owner to know site letter\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=context.Base_getOwnerId())\n
for site in site_list:\n
if context.portal_categories.getCategoryValue(site).getVaultType().endswith(\'/guichet\'):\n
return site\n
from Products.ERP5Type.Message import Message\n
message = Message(domain="ui", message="Object owner is not assigned to a counter.")\n
raise ValueError,message\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>*args, **kw</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>args</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>source</string>
<string>None</string>
<string>site_list</string>
<string>_getiter_</string>
<string>site</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>message</string>
<string>ValueError</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>CounterRendering_getBaobabSource</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -66,20 +66,17 @@
<item>
<key> <string>_body</string> </key>
<value> <string>destination = context.getDestination()\n
if destination is None:\n
return None\n
user_id = context.Base_getLastUserIdByTransition(workflow_id=\'internal_money_deposit_workflow\', transition_id=\'deliver_action\')\n
if user_id is None:\n
return None\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=user_id)\n
if destination is not None:\n
return destination+\'/encaisse_des_billets_et_monnaies/entrante\'\n
# calculate the destination\n
# must use owner to know site letter\n
site_list = context.Baobab_getUserAssignedSiteList(user_id=context.Base_getOwnerId())\n
for site in site_list:\n
# if context.portal_categories.getCategoryValue(site).getVaultType().endswith(\'guichet\') and (destination in site or site in destination):\n
if context.portal_categories.getCategoryValue(site).getVaultType().endswith(\'guichet\') and destination in site:\n
return site + \'/encaisse_des_billets_et_monnaies/entrante\'\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
if context.portal_categories.getCategoryValue(site).getVaultType().endswith(\'/guichet\'):\n
return site+"/entrante"\n
from Products.ERP5Type.Message import Message\n
msg = Message(domain=\'ui\', message=\'Your user is not well assigned\')\n
raise ValidationFailed, (msg,)\n
message = Message(domain="ui", message="Object owner is not assigned to a counter.")\n
raise ValueError,message\n
</string> </value>
</item>
<item>
......@@ -102,7 +99,7 @@ raise ValidationFailed, (msg,)\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -128,21 +125,17 @@ raise ValidationFailed, (msg,)\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>args</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>destination</string>
<string>None</string>
<string>user_id</string>
<string>site_list</string>
<string>_getiter_</string>
<string>site</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>msg</string>
<string>message</string>
<string>ValueError</string>
</tuple>
</value>
</item>
......
275
\ No newline at end of file
277
\ 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