Commit 79dc23e2 authored by Aurel's avatar Aurel

many forms and scripts modifications

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8529 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2f1d43a4
......@@ -93,7 +93,7 @@ if resource is None :\n
\n
# Next, check the balance of the account\n
account_balance = resource.getFutureInventory(payment=payment, src__=src__)\n
\n
context.log("account balance",account_balance)\n
if src__ :\n
return account_balance \n
\n
......@@ -128,6 +128,14 @@ return {\'error_code\':0, \'balance\':account_balance} # ok\n
<key> <string>_params</string> </key>
<value> <string>payment, quantity, src__=0</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>
......
<?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># We will take the emission letter and find what is the right site\n
# for it and the return the result\n
\n
site_item_list = context.Delivery_getVaultItemList(vault_type=(\'site\',),user_site=0,\n
with_base=0,strict_membership=1,\n
leaf_node=0)\n
site_path_list = [x[1] for x in site_item_list if x[1]!=\'\' and \'principale\' in x[1]]\n
site_base_category = context.portal_categories.site\n
for site_path in site_path_list:\n
site = site_base_category.restrictedTraverse(site_path)\n
if site.getCodification()[:1].lower()==emission_letter:\n
return site\n
return None\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/baobab/portal_skins/erp5_banking_core/Baobab_getEmissionLetterSiteValue</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>emission_letter=None</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>emission_letter</string>
<string>_getattr_</string>
<string>context</string>
<string>site_item_list</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>_getitem_</string>
<string>site_path_list</string>
<string>site_base_category</string>
<string>site_path</string>
<string>site</string>
<string>None</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_getEmissionLetterSiteValue</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,9 +68,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from DateTime import DateTime\n
\n
context.edit(variation_base_category_list = [\'check_amount\'])\n
<value> <string># in this script you must return the default value of the account for this site\n
# this must correspond to the relative url of the default account\n
return \'\'\n
</string> </value>
</item>
<item>
......@@ -81,7 +81,7 @@ context.edit(variation_base_category_list = [\'check_amount\'])\n
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/baobab/portal_skins/erp5_banking_core/CheckbookModel_init</string> </value>
<value> <string>Script (Python):/baobab/portal_skins/erp5_banking_core/Baobab_getPortalDefaultPaymentNode</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
......@@ -91,7 +91,7 @@ context.edit(variation_base_category_list = [\'check_amount\'])\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -116,12 +116,7 @@ context.edit(variation_base_category_list = [\'check_amount\'])\n
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>DateTime</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
<tuple/>
</value>
</item>
</dictionary>
......@@ -137,7 +132,7 @@ context.edit(variation_base_category_list = [\'check_amount\'])\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CheckbookModel_init</string> </value>
<value> <string>Baobab_getPortalDefaultPaymentNode</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -86,9 +86,9 @@ for site in site_list:\n
counter = "/".join(site_split[:-1])\n
if not site_dict.has_key(counter):\n
if not \'siege\' in site[1]:\n
site_dict[counter] = \'/\'.join(site[1].split("/")[:6])\n
site_dict[counter] = \'/\'.join(site[1].split("/")[:7])\n
else:\n
site_dict[counter] = \'/\'.join(site[1].split("/")[:5])\n
site_dict[counter] = \'/\'.join(site[1].split("/")[:6])\n
else:\n
site_dict[site[0]] = site[1]\n
\n
......
......@@ -73,7 +73,7 @@
if bank_account in (\'\', None):\n
return []\n
\n
return bank_account.searchFolder()\n
return bank_account.searchFolder(**kw)\n
</string> </value>
</item>
<item>
......@@ -125,6 +125,7 @@ return bank_account.searchFolder()\n
<string>context</string>
<string>bank_account</string>
<string>None</string>
<string>_apply_</string>
</tuple>
</value>
</item>
......
......@@ -75,6 +75,9 @@
emission_letter_dict = {}\n
user_site_list = []\n
if site == None :\n
if user is not None:\n
user_site_list = context.Baobab_getUserAssignedSiteList(user)\n
else:\n
user_site_list = context.Baobab_getUserAssignedSiteList()\n
else :\n
user_site_list.append(site)\n
......@@ -83,6 +86,7 @@ if len(user_site_list) > 0:\n
for a in user_site_list:\n
if not a.startswith(\'site\'):\n
a = \'site/\' + a\n
context.log("a", a)\n
site_codification = context.portal_categories.getCategoryValue(a).getCodification()\n
if site_codification not in (\'\', None):\n
emission_letter_dict[site_codification[0].lower()] = 1\n
......@@ -110,7 +114,7 @@ return emission_letter_dict.keys()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>site = None</string> </value>
<value> <string>user=None, site = None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -130,12 +134,13 @@ return emission_letter_dict.keys()\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>user</string>
<string>site</string>
<string>emission_letter_dict</string>
<string>user_site_list</string>
......@@ -161,6 +166,7 @@ return emission_letter_dict.keys()\n
<value>
<tuple>
<none/>
<none/>
</tuple>
</value>
</item>
......
......@@ -83,8 +83,8 @@ requested_dict = {}\n
\n
# test all movement\n
tmp_list = context.contentValues(filter={\'portal_type\': portal_type})\n
#context.log(\'tmp_list\', str((tmp_list, portal_type, context)))\n
#context.log(\'source\',source)\n
context.log(\'tmp_list\', str((tmp_list, portal_type, context)))\n
context.log(\'source\',source)\n
line_list = []\n
for l in tmp_list :\n
# The source can be different for every line (due to getBaobabSource approach)\n
......@@ -96,7 +96,7 @@ for l in tmp_list :\n
line_list.append(l)\n
except (AttributeError, KeyError):\n
pass\n
#context.log("line list", line_list)\n
context.log("line list", line_list)\n
if len(line_list) == 0 :\n
# no resource\n
return 2\n
......@@ -186,6 +186,7 @@ return 0\n
<string>_getattr_</string>
<string>context</string>
<string>tmp_list</string>
<string>str</string>
<string>line_list</string>
<string>_getiter_</string>
<string>l</string>
......@@ -197,7 +198,6 @@ return 0\n
<string>line_resource</string>
<string>cell</string>
<string>variation_text</string>
<string>str</string>
<string>inventory_value</string>
</tuple>
</value>
......
......@@ -120,7 +120,9 @@ if listbox is None:\n
\n
\n
# If use_inventory is passed, use that value. Otherwise, assume False.\n
use_inventory = cash_detail_dict.get(\'use_inventory\', False)\n
# use_inventory = cash_detail_dict.get(\'use_inventory\', False)\n
# assume this is always false as we don\'t need to distinguish this anymore\n
use_inventory = False\n
\n
if currency_cash_portal_type is None:\n
currency_cash_portal_type = (\'Banknote\',\'Coin\')\n
......@@ -444,10 +446,10 @@ else :\n
<string>column_base_category</string>
<string>read_only</string>
<string>currency_cash_portal_type</string>
<string>_getattr_</string>
<string>False</string>
<string>use_inventory</string>
<string>list</string>
<string>_getattr_</string>
<string>context</string>
<string>currency</string>
<string>result</string>
......
......@@ -265,7 +265,7 @@ if variation_not_defined:\n
else:\n
request = context.REQUEST\n
redirect_url = \'%s/view?%s\' % ( context.absolute_url()\n
, \'portal_status_message=Lines Created\'\n
, \'portal_status_message=Lines%%20Created\'\n
)\n
request[ \'RESPONSE\' ].redirect( redirect_url )\n
......
......@@ -346,9 +346,13 @@
<string>Title</string>
</tuple>
<tuple>
<string>default_destination_section_title</string>
<string>destination_trade_title</string>
<string>Holder</string>
</tuple>
<tuple>
<string>resource_title</string>
<string>Check Type</string>
</tuple>
<tuple>
<string>check_amount_title</string>
<string>Check Amount</string>
......
......@@ -106,9 +106,8 @@
<value>
<list>
<string>my_title</string>
<string>my_resource</string>
<string>my_destination_payment_reference</string>
<string>my_price_currency</string>
<string>my_destination_title</string>
<string>my_destination_payment_title</string>
</list>
</value>
</item>
......
......@@ -20,7 +20,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_destination_payment_reference</string> </value>
<value> <string>my_destination_payment_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -30,6 +30,18 @@
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>relation_result_ambiguous</string> </key>
<value> <string>Select appropriate document in the list.</string> </value>
</item>
<item>
<key> <string>relation_result_empty</string> </key>
<value> <string>No such document was found.</string> </value>
</item>
<item>
<key> <string>relation_result_too_long</string> </key>
<value> <string>Too many documents were found.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
......@@ -57,6 +69,10 @@
<key> <string>catalog_index</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
......@@ -97,18 +113,38 @@
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>first_item</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>jump_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>parameter_list</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string></string> </value>
......@@ -121,6 +157,14 @@
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
......@@ -148,14 +192,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>allow_creation</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>allow_jump</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
......@@ -172,19 +208,13 @@
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>container_getter_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_module</string> </key>
......@@ -233,7 +263,7 @@
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
......@@ -248,14 +278,6 @@
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>parameter_list</string> </key>
<value> <string></string> </value>
......@@ -309,7 +331,7 @@
<dictionary>
<item>
<key> <string>allow_creation</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>allow_jump</string> </key>
......@@ -325,7 +347,7 @@
</item>
<item>
<key> <string>catalog_index</string> </key>
<value> <string>reference</string> </value>
<value> <string>title</string> </value>
</item>
<item>
<key> <string>columns</string> </key>
......@@ -347,7 +369,7 @@
</item>
<item>
<key> <string>default_module</string> </key>
<value> <string>person</string> </value>
<value> <string>Accounting</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -444,7 +466,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Bank Account Number</string> </value>
<value> <string>Bank Account</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
......@@ -469,25 +491,6 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getDestinationPaymentValue().getReference()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
......
......@@ -105,6 +105,7 @@
<key> <string>left</string> </key>
<value>
<list>
<string>my_destination</string>
<string>my_resource</string>
<string>my_variation_category_list</string>
</list>
......
......@@ -20,7 +20,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_price_currency</string> </value>
<value> <string>my_destination</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -257,7 +257,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Currency</string> </value>
<value> <string>Emission Site</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
......@@ -287,7 +287,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.CurrencyModule_getCurrencyItemList()</string> </value>
<value> <string>python:here.Delivery_getVaultItemList(vault_type = \'site\', current_url = None, user_site = 1, leaf_node = 0, strict_membership = 1)</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -287,7 +287,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(\'\', \'\')] + [(x.getTitle(), x.getRelativeUrl()) for x in here.checkbook_model_module.objectValues(portal_type=\'Checkbook Model\')]</string> </value>
<value> <string>python: [(\'\', \'\')] + [(x.getTitle(), x.getRelativeUrl()) for x in here.checkbook_model_module.objectValues()]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -100,14 +100,19 @@ if kw.has_key("portal_type"):\n
\n
if at_date is not None:\n
inventory_kw[\'at_date\'] = at_date\n
\n
\n
if from_date is not None:\n
inventory_kw[\'from_date\'] = from_date\n
\n
vault_inventory_list = context.portal_simulation.getCurrentInventoryList( node_category=vault\n
, ignore_variation=0\n
,**inventory_kw\n
)\n
#context.log(\'CounterMOdule_getVaultTransactionList, sql src:\',context.portal_simulation.getCurrentInventoryList( node_category=vault\n
# , ignore_variation=0,src__=1\n
# ,**inventory_kw\n
# ))\n
# context.log(\'CounterMOdule_getVaultTransactionList, sql src:\',context.portal_simulation.getCurrentInventoryList( node_category=vault\n
# , ignore_variation=0,src__=1\n
# ,**inventory_kw\n
# ))\n
\n
#context.log(\'len(vault_inventory_list:\',len(vault_inventory_list))\n
for vault_inventory in vault_inventory_list:\n
......
......@@ -68,13 +68,15 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>price = context.CurrencyExchange_getExchangeRateList()[1] * context.getBasePrice()\n
<value> <string>price = context.ERP5Banking_getExchangeValue()\n
\n
commission_ratio = context.getDiscountRatio()\n
commission_price = context.getDiscount()\n
if commission_ratio is not None and commission_ratio !=0 and commission_price is not None and commission_price !=0:\n
return None\n
if (commission_ratio is None or commission_ratio == 0) and (commission_price is None or commission_price == 0):\n
if commission_ratio == 0 or commission_price == 0:\n
return price\n
if commission_ratio is None and commission_price is None:\n
return None\n
\n
if commission_ratio is not None:\n
......@@ -132,7 +134,6 @@ return quantity\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getitem_</string>
<string>_getattr_</string>
<string>context</string>
<string>price</string>
......
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