Commit 2c62cccb authored by Aurel's avatar Aurel

improve a bit code of init script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13578 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 54fd2c4a
......@@ -69,7 +69,10 @@
<item>
<key> <string>_body</string> </key>
<value> <string>user_site = context.Baobab_getUserAssignedRootSiteList()[0]\n
context.edit(source=user_site)\n
if user_site in (None, \'\'):\n
raise ValueError, "Unable to determine user site"\n
else:\n
context.edit(source=user_site)\n
</string> </value>
</item>
<item>
......@@ -122,8 +125,10 @@ context.edit(source=user_site)\n
<string>kw</string>
<string>_getitem_</string>
<string>_getattr_</string>
<string>context</string>
<string>context</string>
<string>user_site</string>
<string>None</string>
<string>ValueError</string>
</tuple>
</value>
</item>
......
......@@ -70,7 +70,7 @@
<key> <string>_body</string> </key>
<value> <string>site_list = context.Baobab_getUserAssignedSiteList()\n
if len(site_list) == 0:\n
context.log("ClassificationSurvey_init", "unabled to determine site")\n
raise ValueError, "Unable to determine site"\n
\n
site = site_list[0]\n
site = context.Baobab_getVaultSite(site)\n
......@@ -123,6 +123,7 @@ context.setSource("%s/caveau/auxiliaire/encaisse_des_billets_ventiles_et_detruit
<string>context</string>
<string>site_list</string>
<string>len</string>
<string>ValueError</string>
<string>_getitem_</string>
<string>site</string>
</tuple>
......
......@@ -68,13 +68,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># create a default banking operation line that will be updated later\n
#context.edit(external_software=\'star\')\n
\n
transaction = context\n
\n
# XXX it might be better to set resource according to source_payment.\n
transaction.setResource(\'currency_module/\' + context.Baobab_getPortalReferenceCurrencyID())\n
<value> <string>context.setResource(\'currency_module/\' + context.Baobab_getPortalReferenceCurrencyID())\n
\n
context.setDestination(context.getBaobabDestination())\n
\n
......@@ -132,9 +126,8 @@ movement = context.newContent(portal_type=\'Banking Operation Line\',\n
<value>
<tuple>
<string>kw</string>
<string>context</string>
<string>transaction</string>
<string>_getattr_</string>
<string>context</string>
<string>movement</string>
</tuple>
</value>
......
......@@ -68,9 +68,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.log("MoneyDeposit_getBaobabDestinationPayment", "in get Destination Payment")\n
\n
return context.Baobab_getPortalDefaultPaymentNode()\n
<value> <string>return context.Baobab_getPortalDefaultPaymentNode()\n
</string> </value>
</item>
<item>
......
......@@ -69,7 +69,10 @@
<item>
<key> <string>_body</string> </key>
<value> <string>user_site = context.Baobab_getUserAssignedRootSiteList()[0]\n
context.edit(source=user_site, source_trade=user_site)\n
if user_site in (\'\', None):\n
raise ValueError, "Unable to determine site"\n
else:\n
context.edit(source=user_site, source_trade=user_site)\n
</string> </value>
</item>
<item>
......@@ -123,6 +126,8 @@ context.edit(source=user_site, source_trade=user_site)\n
<string>_getattr_</string>
<string>context</string>
<string>user_site</string>
<string>None</string>
<string>ValueError</string>
</tuple>
</value>
</item>
......
223
\ No newline at end of file
225
\ 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