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 @@ ...@@ -69,7 +69,10 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>user_site = context.Baobab_getUserAssignedRootSiteList()[0]\n <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> </string> </value>
</item> </item>
<item> <item>
...@@ -122,8 +125,10 @@ context.edit(source=user_site)\n ...@@ -122,8 +125,10 @@ context.edit(source=user_site)\n
<string>kw</string> <string>kw</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>user_site</string> <string>user_site</string>
<string>None</string>
<string>ValueError</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>site_list = context.Baobab_getUserAssignedSiteList()\n <value> <string>site_list = context.Baobab_getUserAssignedSiteList()\n
if len(site_list) == 0:\n if len(site_list) == 0:\n
context.log("ClassificationSurvey_init", "unabled to determine site")\n raise ValueError, "Unable to determine site"\n
\n \n
site = site_list[0]\n site = site_list[0]\n
site = context.Baobab_getVaultSite(site)\n site = context.Baobab_getVaultSite(site)\n
...@@ -123,6 +123,7 @@ context.setSource("%s/caveau/auxiliaire/encaisse_des_billets_ventiles_et_detruit ...@@ -123,6 +123,7 @@ context.setSource("%s/caveau/auxiliaire/encaisse_des_billets_ventiles_et_detruit
<string>context</string> <string>context</string>
<string>site_list</string> <string>site_list</string>
<string>len</string> <string>len</string>
<string>ValueError</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>site</string> <string>site</string>
</tuple> </tuple>
......
...@@ -68,13 +68,7 @@ ...@@ -68,13 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># create a default banking operation line that will be updated later\n <value> <string>context.setResource(\'currency_module/\' + context.Baobab_getPortalReferenceCurrencyID())\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
\n \n
context.setDestination(context.getBaobabDestination())\n context.setDestination(context.getBaobabDestination())\n
\n \n
...@@ -132,9 +126,8 @@ movement = context.newContent(portal_type=\'Banking Operation Line\',\n ...@@ -132,9 +126,8 @@ movement = context.newContent(portal_type=\'Banking Operation Line\',\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>context</string>
<string>transaction</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
<string>movement</string> <string>movement</string>
</tuple> </tuple>
</value> </value>
......
...@@ -68,9 +68,7 @@ ...@@ -68,9 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>context.log("MoneyDeposit_getBaobabDestinationPayment", "in get Destination Payment")\n <value> <string>return context.Baobab_getPortalDefaultPaymentNode()\n
\n
return context.Baobab_getPortalDefaultPaymentNode()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -69,7 +69,10 @@ ...@@ -69,7 +69,10 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>user_site = context.Baobab_getUserAssignedRootSiteList()[0]\n <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> </string> </value>
</item> </item>
<item> <item>
...@@ -123,6 +126,8 @@ context.edit(source=user_site, source_trade=user_site)\n ...@@ -123,6 +126,8 @@ context.edit(source=user_site, source_trade=user_site)\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>user_site</string> <string>user_site</string>
<string>None</string>
<string>ValueError</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
223 225
\ No newline at end of file \ 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