Commit b62636a2 authored by Aurel's avatar Aurel

commit many improvement to scripts and forms

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7346 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fd378574
...@@ -42,6 +42,22 @@ ...@@ -42,6 +42,22 @@
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>acquisition_portal_type</string> </key>
<value> <string>python: []</string> </value>
</item>
<item>
<key> <string>category_type_list </string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>vault_type</string> </value> <value> <string>vault_type</string> </value>
......
...@@ -69,16 +69,20 @@ ...@@ -69,16 +69,20 @@
<value> <string># return counter list for a given site and a given vault type\n <value> <string># return counter list for a given site and a given vault type\n
\n \n
if vault_type is None:\n if vault_type is None:\n
vault_type = (\'site/surface/banque_interne\', \'site/surface/gros_paiement\', \'site/surface/gros_versement\', \'site/surface/operations_diverses\')\n vault_type = (\'site/surface/banque_interne\', \'site/surface/gros_paiement\', \'site/surface/gros_versement\', \'site/surface/operations_diverses\')\n
\n \n
\n \n
vault_list = context.Delivery_getVaultItemList(vault_type=vault_type, strict_membership = 0, leaf_node=0, user_site=1, with_base=0)\n vault_list = context.Delivery_getVaultItemList(vault_type=vault_type, strict_membership = 0, leaf_node=0, user_site=1, with_base=0)\n
counter_dict = {}\n counter_dict = {}\n
for vault in vault_list:\n for vault in vault_list:\n
if len(vault[0].split("/")) == 4:\n if len(vault[0].split("/")) == 4:\n
counter = \'/\'.join(vault[0].split("/")[:3])\n counter = \'/\'.join(vault[0].split("/")[:3])\n
if not counter_dict.has_key(counter):\n if not counter_dict.has_key(counter):\n
counter_dict[counter] = \'/\'.join(vault[1].split("/")[:6])\n if not \'siege\' in vault[1]:\n
counter_dict[counter] = \'/\'.join(vault[1].split("/")[:6])\n
else:\n
counter_dict[counter] = \'/\'.join(vault[1].split("/")[:5])\n
\n
\n \n
list = counter_dict.items()\n list = counter_dict.items()\n
list.sort()\n list.sort()\n
......
<?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> <string encoding="base64">bfINCg==</string> </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># return site of the user and possible counter on wich user can be assigned\n
if context.getDestination() is None:\n
# must have an organisation defined to limit site diplayed\n
return [[\'\', \'\']]\n
\n
dest_site_title = context.getDestinationValue().getSiteTitle()\n
\n
site_list = context.Delivery_getVaultItemList(user_site=0, vault_type=("site", "site/surface/banque_interne/guichet", "site/surface/gros_paiement/guichet", "site/surface/gros_versement/guichet"), strict_membership=1, leaf_node=0)\n
site_dict = {}\n
for site in site_list:\n
site_split = site[0].split(\'/\')\n
if dest_site_title in site_split:\n
if len(site_split) == 4:\n
# case of counter\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
else:\n
site_dict[counter] = \'/\'.join(site[1].split("/")[:5])\n
else:\n
site_dict[site[0]] = site[1]\n
\n
list = site_dict.items()\n
list.sort()\n
return list\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_getPossibleUserAssignmentSiteList</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>_getattr_</string>
<string>context</string>
<string>None</string>
<string>dest_site_title</string>
<string>site_list</string>
<string>site_dict</string>
<string>_getiter_</string>
<string>site</string>
<string>_getitem_</string>
<string>site_split</string>
<string>len</string>
<string>counter</string>
<string>_write_</string>
<string>list</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>Baobab_getPossibleUserAssignmentSiteList</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>
...@@ -70,9 +70,9 @@ ...@@ -70,9 +70,9 @@
\n \n
def getResourceVintageList(banknote=0, coin=0):\n def getResourceVintageList(banknote=0, coin=0):\n
variation_list = {}\n variation_list = {}\n
if banknote:\n if banknote and not coin:\n
portal_type_list = ["Banknote",]\n portal_type_list = ["Banknote",]\n
elif coin:\n elif coin and not banknote:\n
portal_type_list = ["Coin",]\n portal_type_list = ["Coin",]\n
else:\n else:\n
portal_type_list = ["Banknote", "Coin"]\n portal_type_list = ["Banknote", "Coin"]\n
......
...@@ -99,8 +99,8 @@ ...@@ -99,8 +99,8 @@
<value> <value>
<list> <list>
<string>matrixbox_membership_criterion_category_list</string> <string>matrixbox_membership_criterion_category_list</string>
<string>matrixbox_quantity</string>
<string>membership_criterion_base_category_list</string> <string>membership_criterion_base_category_list</string>
<string>matrixbox_quantity</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<value> <value>
<list> <list>
<string>my_resource_title</string> <string>my_resource_title</string>
<string>my_total_price </string> <string>my_total_price</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<tuple> <tuple>
<tuple> <tuple>
<string>Products.Formulator.StandardFields</string> <string>Products.Formulator.StandardFields</string>
<string>IntegerField</string> <string>FloatField</string>
</tuple> </tuple>
<none/> <none/>
</tuple> </tuple>
...@@ -31,12 +31,8 @@ ...@@ -31,12 +31,8 @@
<value> <string>The input failed the external validator.</string> </value> <value> <string>The input failed the external validator.</string> </value>
</item> </item>
<item> <item>
<key> <string>integer_out_of_range</string> </key> <key> <string>not_float</string> </key>
<value> <string>The integer you entered was out of range.</string> </value> <value> <string>You did not enter a floating point number.</string> </value>
</item>
<item>
<key> <string>not_integer</string> </key>
<value> <string>You did not enter an integer.</string> </value>
</item> </item>
<item> <item>
<key> <string>required_not_found</string> </key> <key> <string>required_not_found</string> </key>
...@@ -81,10 +77,6 @@ ...@@ -81,10 +77,6 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -98,11 +90,15 @@ ...@@ -98,11 +90,15 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>start</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -154,10 +150,6 @@ ...@@ -154,10 +150,6 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -171,11 +163,15 @@ ...@@ -171,11 +163,15 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>input_style</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>start</string> </key> <key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -225,30 +221,30 @@ ...@@ -225,30 +221,30 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string>align=right</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>input_style</string> </key>
<value> <int>0</int> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item> <item>
<key> <string>start</string> </key> <key> <string>precision</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>matrixbox_quantity</string> </value> <value> <string>matrixbox_quantity</string> </value>
...@@ -277,7 +273,7 @@ ...@@ -277,7 +273,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.Integer_toString(int(cell.getProperty(\'quantity\')))</string> </value> <value> <string>python: int(cell.getProperty(\'quantity\'))</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<tuple> <tuple>
<tuple> <tuple>
<string>Products.Formulator.StandardFields</string> <string>Products.Formulator.StandardFields</string>
<string>IntegerField</string> <string>FloatField</string>
</tuple> </tuple>
<none/> <none/>
</tuple> </tuple>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_total_price </string> </value> <value> <string>my_total_price</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -31,12 +31,8 @@ ...@@ -31,12 +31,8 @@
<value> <string>The input failed the external validator.</string> </value> <value> <string>The input failed the external validator.</string> </value>
</item> </item>
<item> <item>
<key> <string>integer_out_of_range</string> </key> <key> <string>not_float</string> </key>
<value> <string>The integer you entered was out of range.</string> </value> <value> <string>You did not enter a floating point number.</string> </value>
</item>
<item>
<key> <string>not_integer</string> </key>
<value> <string>You did not enter an integer.</string> </value>
</item> </item>
<item> <item>
<key> <string>required_not_found</string> </key> <key> <string>required_not_found</string> </key>
...@@ -81,10 +77,6 @@ ...@@ -81,10 +77,6 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -98,11 +90,15 @@ ...@@ -98,11 +90,15 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>start</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -154,10 +150,6 @@ ...@@ -154,10 +150,6 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -171,11 +163,15 @@ ...@@ -171,11 +163,15 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>input_style</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>start</string> </key> <key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -225,10 +221,6 @@ ...@@ -225,10 +221,6 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>external_validator</string> </key> <key> <string>external_validator</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -242,16 +234,20 @@ ...@@ -242,16 +234,20 @@
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>input_style</string> </key>
<value> <int>0</int> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item> <item>
<key> <string>start</string> </key> <key> <string>precision</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Montant Total</string> </value> <value> <string>Total Amount</string> </value>
</item> </item>
<item> <item>
<key> <string>whitespace_preserve</string> </key> <key> <string>whitespace_preserve</string> </key>
...@@ -277,7 +273,7 @@ ...@@ -277,7 +273,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here.Integer_toString(int(here.getTotalPrice()))</string> </value> <value> <string>python: int(here.getTotalPrice(fast=0))</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -350,6 +350,10 @@ ...@@ -350,6 +350,10 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -431,8 +435,8 @@ ...@@ -431,8 +435,8 @@
<value> <value>
<list> <list>
<tuple> <tuple>
<string>Cash Container Line</string> <string>Container Line</string>
<string>Cash Container Line</string> <string>Container Line</string>
</tuple> </tuple>
</list> </list>
</value> </value>
......
...@@ -78,40 +78,28 @@ resource_dict = {}\n ...@@ -78,40 +78,28 @@ resource_dict = {}\n
vault_dict = {}\n vault_dict = {}\n
vault_inventory_dict = {}\n vault_inventory_dict = {}\n
\n \n
for vault in context.objectValues():\n vault_url = vault\n
vault_url = vault.getRelativeUrl()\n vault_dict[vault_url] = 1\n
vault_dict[vault_url] = 1\n vault_inventory_dict[vault_url] = {}\n
vault_inventory_dict[vault_url] = {}\n vault_inventory_list = context.portal_simulation.getInventoryList( node_category=vault\n
for vault_inventory in context.portal_simulation.getInventoryStat( node_category=vault.getRelativeUrl()\n #, resource_category=\'currency/\' + context.Baobab_getPortalReferenceCurrencyID()\n
, resource_category=\'currency/\' + context.Baobab_getPortalReferenceCurrencyID()\n , ignore_variation=0\n
, ignore_variation=0\n )\n
):\n context.log(\'len(vault_inventory_list:\',len(vault_inventory_list))\n
try:\n for vault_inventory in vault_inventory_list:\n
resource = (vault_inventory[8], getVariationTitleList(vault_inventory[10])[2])\n context.log(\'vault_inventory total_quantity\',vault_inventory.total_quantity)\n
except:\n context.log(\'vault_inventory total_price\',vault_inventory.total_price)\n
raise \'not enough columns\', repr(([x for x in vault_inventory]))\n resource = (vault_inventory.resource_uid, tuple(getVariationTitleList(vault_inventory.resource_relative_url)))\n
\n if not vault_inventory_dict[vault_url].has_key(resource):\n
if not vault_inventory_dict[vault_url].has_key(resource):\n vault_inventory_dict[vault_url][resource] = {\'quantity\':vault_inventory.total_quantity, \'total_price\':vault_inventory.total_price}\n
vault_inventory_dict[vault_url][resource] = {\'quantity\':0, \'total_price\':0}\n
quantity = vault_inventory[1] or 0\n
total_price = vault_inventory[2] or 0\n
vault_inventory_dict[vault_url][resource][\'quantity\'] = vault_inventory_dict[vault_url][resource][\'quantity\'] + quantity\n
vault_inventory_dict[vault_url][resource][\'total_price\'] = vault_inventory_dict[vault_url][resource][\'total_price\'] + total_price\n
\n
resource_dict[resource] = 1\n
\n \n
#return repr(vault_inventory_dict)\n resource_dict[resource] = 1\n
\n \n
#for v in vault_inventory_dict.items():\n
# print v[0]\n
# for r in v[1].items():\n
# print repr(r)\n
\n
#return printed\n
\n \n
if column_names == 1:\n if column_names == 1:\n
column_list = [(\'resource\', \'Resource\'), (\'variation_text\', \'Year\')]\n column_list = [(\'resource\', \'Resource\'), (\'variation_text\', \'Year\')]\n
for vault in vault_dict.keys():\n for vault in vault_dict.keys():\n
context.log(\'getTitleFromCategoryUrl(vault)\',getTitleFromCategoryUrl(vault))\n
column_list.extend([\n column_list.extend([\n
(vault + \'_quantity\', getTitleFromCategoryUrl(vault) + \' Quantity\'),\n (vault + \'_quantity\', getTitleFromCategoryUrl(vault) + \' Quantity\'),\n
(vault + \'_total_price\', getTitleFromCategoryUrl(vault) + \' TotalPrice\')\n (vault + \'_total_price\', getTitleFromCategoryUrl(vault) + \' TotalPrice\')\n
...@@ -121,19 +109,24 @@ if column_names == 1:\n ...@@ -121,19 +109,24 @@ if column_names == 1:\n
\n \n
total_inventory_list = []\n total_inventory_list = []\n
\n \n
context.log(\'resource_dict\',resource_dict)\n
context.log(\'vault_inventory_dict\',vault_inventory_dict)\n
\n
i = 0\n
for resource in context.Baobab_sortResourceTitleList(resource_dict.keys()):\n for resource in context.Baobab_sortResourceTitleList(resource_dict.keys()):\n
tmp_dict = {\'resource\':resource[0][:resource[0].find(\'Fran\')], \'variation_text\':resource[1]}\n tmp_dict = {\'resource\':resource[0], \'variation_text\':resource[1]}\n
general_total_price = 0\n general_total_price = 0\n
for vault in vault_dict.keys():\n for vault in vault_dict.keys():\n
try:\n try:\n
resource_in_vault = vault_inventory_dict[vault][resource]\n resource_in_vault = vault_inventory_dict[vault][resource]\n
except KeyError:\n except KeyError:\n
resource_in_vault = {\'quantity\' : 0,\'total_price\' : 0}\n resource_in_vault = {\'quantity\' : 0,\'total_price\' : 0}\n
tmp_dict.update({vault + \'_quantity\' : resource_in_vault[\'quantity\'],\n tmp_dict.update({\'total_quantity\' : resource_in_vault[\'quantity\'],\n
vault + \'_total_price\' : resource_in_vault[\'total_price\']})\n \'total_price\' : resource_in_vault[\'total_price\']})\n
general_total_price += resource_in_vault[\'total_price\']\n general_total_price += resource_in_vault[\'total_price\']\n
tmp_dict[\'general_total_price\'] = general_total_price\n tmp_dict[\'general_total_price\'] = general_total_price\n
total_inventory_list.append(newTempBase(context, resource, **tmp_dict))\n total_inventory_list.append(newTempBase(context, "new_%3i" % i, **tmp_dict))\n
i += 1\n
return total_inventory_list\n return total_inventory_list\n
return repr([x for x in total_inventory_list])\n return repr([x for x in total_inventory_list])\n
</string> </value> </string> </value>
...@@ -144,6 +137,12 @@ return repr([x for x in total_inventory_list])\n ...@@ -144,6 +137,12 @@ return repr([x for x in total_inventory_list])\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_dav_writelocks</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
<value> <string>Script (Python):/baobab/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList</string> </value> <value> <string>Script (Python):/baobab/portal_skins/erp5_banking_core/CounterModule_getVaultTransactionList</string> </value>
...@@ -156,7 +155,7 @@ return repr([x for x in total_inventory_list])\n ...@@ -156,7 +155,7 @@ return repr([x for x in total_inventory_list])\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>column_names=0, **kw</string> </value> <value> <string>vault=None,column_names=0, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -176,12 +175,13 @@ return repr([x for x in total_inventory_list])\n ...@@ -176,12 +175,13 @@ return repr([x for x in total_inventory_list])\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>1</int> </value> <value> <int>2</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>vault</string>
<string>column_names</string> <string>column_names</string>
<string>kw</string> <string>kw</string>
<string>Products.ERP5Type.Document</string> <string>Products.ERP5Type.Document</string>
...@@ -191,28 +191,29 @@ return repr([x for x in total_inventory_list])\n ...@@ -191,28 +191,29 @@ return repr([x for x in total_inventory_list])\n
<string>resource_dict</string> <string>resource_dict</string>
<string>vault_dict</string> <string>vault_dict</string>
<string>vault_inventory_dict</string> <string>vault_inventory_dict</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>vault</string>
<string>vault_url</string> <string>vault_url</string>
<string>_write_</string> <string>_write_</string>
<string>_getattr_</string>
<string>context</string>
<string>vault_inventory_list</string>
<string>len</string>
<string>_getiter_</string>
<string>vault_inventory</string> <string>vault_inventory</string>
<string>_getitem_</string> <string>tuple</string>
<string>resource</string> <string>resource</string>
<string>repr</string> <string>_getitem_</string>
<string>append</string>
<string>$append0</string>
<string>x</string>
<string>quantity</string>
<string>total_price</string>
<string>column_list</string> <string>column_list</string>
<string>total_inventory_list</string> <string>total_inventory_list</string>
<string>i</string>
<string>tmp_dict</string> <string>tmp_dict</string>
<string>general_total_price</string> <string>general_total_price</string>
<string>resource_in_vault</string> <string>resource_in_vault</string>
<string>KeyError</string> <string>KeyError</string>
<string>_apply_</string> <string>_apply_</string>
<string>repr</string>
<string>append</string>
<string>$append0</string>
<string>x</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -225,6 +226,7 @@ return repr([x for x in total_inventory_list])\n ...@@ -225,6 +226,7 @@ return repr([x for x in total_inventory_list])\n
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple> <tuple>
<none/>
<int>0</int> <int>0</int>
</tuple> </tuple>
</value> </value>
...@@ -242,4 +244,25 @@ return repr([x for x in total_inventory_list])\n ...@@ -242,4 +244,25 @@ return repr([x for x in total_inventory_list])\n
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string>Report</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode_mode</string> </key> <key> <string>unicode_mode</string> </key>
......
...@@ -188,6 +188,10 @@ def getVaultItemList(vault_type=None, exclude_vault_type=None,\n ...@@ -188,6 +188,10 @@ def getVaultItemList(vault_type=None, exclude_vault_type=None,\n
for i in xrange(path_len):\n for i in xrange(path_len):\n
if i%2 == 0 and i != 0:\n if i%2 == 0 and i != 0:\n
new_title_list.append(title_path_list[i])\n new_title_list.append(title_path_list[i])\n
elif \'Ventilation\' in title_path_list[i]:\n
new_title_list.append(\'Ventilation\')\n
elif \'Transit\' in title_path_list[i]:\n
new_title_list.append(\'Transit\')\n
if id not in new_title_list: # ie last part of path\n if id not in new_title_list: # ie last part of path\n
new_title_list.append(id)\n new_title_list.append(id)\n
# put back the counter name into the list\n # put back the counter name into the list\n
...@@ -220,7 +224,9 @@ if user_site == 1:\n ...@@ -220,7 +224,9 @@ if user_site == 1:\n
for site in site_list:\n for site in site_list:\n
if "guichet" in site:\n if "guichet" in site:\n
site = context.Baobab_getVaultSite(vault=site)\n site = context.Baobab_getVaultSite(vault=site)\n
new_site_list.append(site.getRelativeUrl())\n new_site_list.append(site.getRelativeUrl())\n
else:\n
new_site_list.append(site)\n
site_list = new_site_list\n site_list = new_site_list\n
else:\n else:\n
site_list = [\'site\']\n site_list = [\'site\']\n
......
...@@ -161,13 +161,13 @@ if import_type == \'create_category\' :\n ...@@ -161,13 +161,13 @@ if import_type == \'create_category\' :\n
for e_list in line_list :\n for e_list in line_list :\n
if len(e_list) > 0 :\n if len(e_list) > 0 :\n
e = e_list[0]\n e = e_list[0]\n
try :\n #try :\n
print \'trying to create %s ...\' % lowerCase(e),\n print \'trying to create %s ...\' % lowerCase(e),\n
create_category(e)\n create_category(e)\n
print \'done\'\n print \'done\'\n
except :\n # except AttributeError:\n
print \'Failed\'\n # print \'Failed\'\n
return printed\n # return printed\n
\n \n
\n \n
elif import_type == \'assign_codification\' :\n elif import_type == \'assign_codification\' :\n
...@@ -180,13 +180,13 @@ elif import_type == \'assign_codification\' :\n ...@@ -180,13 +180,13 @@ elif import_type == \'assign_codification\' :\n
# Automatically assign code for some subcategories\n # Automatically assign code for some subcategories\n
context.log(\'e_list[0]\',e_list[0])\n context.log(\'e_list[0]\',e_list[0])\n
if e_list[0].startswith(\'site\'):\n if e_list[0].startswith(\'site\'):\n
vault_code = {\'banque_interne\':\'BI\',\'operations_diverses\':\'OD\',\'gros_paiement\':\'GP\',\'gros_versement\':\'GV\',\n acquired_vault_code = {\'banque_interne\':\'BI\',\'operations_diverses\':\'OD\',\'gros_paiement\':\'GP\',\'gros_versement\':\'GV\',\n
\'guichet_1\':\'G1\',\'guichet_2\':\'G2\',\'guichet_3\':\'G3\'}\n \'guichet_1\':\'G1\',\'guichet_2\':\'G2\',\'guichet_3\':\'G3\'}\n
context.log(\'category\',category.getPath())\n context.log(\'category\',category.getPath())\n
for sub_cat in category.getCategoryChildValueList(sort_id=\'path\'):\n for sub_cat in category.getCategoryChildValueList(sort_id=\'path\'):\n
if sub_cat.getId() in vault_code.keys():\n if sub_cat.getId() in acquired_vault_code.keys():\n
parent_code = sub_cat.getParentValue().getCodification()\n parent_code = sub_cat.getParentValue().getCodification()\n
code = parent_code + vault_code[sub_cat.getId()]\n code = parent_code + acquired_vault_code[sub_cat.getId()]\n
sub_cat.setCodification(code)\n sub_cat.setCodification(code)\n
print \'done %s\' % repr(e_list)\n print \'done %s\' % repr(e_list)\n
except KeyError:\n except KeyError:\n
...@@ -261,7 +261,8 @@ elif import_type == \'create_subvaults\' :\n ...@@ -261,7 +261,8 @@ elif import_type == \'create_subvaults\' :\n
else:\n else:\n
#context.log(\'add encaisse des billets et monnaies\',counter_subvault)\n #context.log(\'add encaisse des billets et monnaies\',counter_subvault)\n
subvault_dict[vault].append([\'%s/%s\' % (counter_subvault, c.getTitle()), None])\n subvault_dict[vault].append([\'%s/%s\' % (counter_subvault, c.getTitle()), None])\n
if subvault == \'Encaisse des Billets Recus pour Ventilation\' :\n if subvault in (\'Encaisse des Billets Recus pour Ventilation Venant de\',\'Encaisse des Billets en Transit Allant a\',\n
\'Encaisse des Billets Neufs Non Emis en Transit Allant a\') :\n
for c in context.portal_categories.site.agence.principale.objectIds() :\n for c in context.portal_categories.site.agence.principale.objectIds() :\n
if counter_name in two_way_counter_list:\n if counter_name in two_way_counter_list:\n
#context.log(\'add ventilation E/S\', counter_subvault)\n #context.log(\'add ventilation E/S\', counter_subvault)\n
...@@ -282,7 +283,10 @@ elif import_type == \'create_subvaults\' :\n ...@@ -282,7 +283,10 @@ elif import_type == \'create_subvaults\' :\n
context.log("vault_type_dict :",subvault_dict)\n context.log("vault_type_dict :",subvault_dict)\n
\n \n
# parse the for site category tree and add sub categories if required\n # parse the for site category tree and add sub categories if required\n
#for c in context.portal_categories.site.getCategoryChildValueList() :\n
#for c in context.portal_categories.site.agence.principale.lome.getCategoryChildValueList() :\n
for c in context.portal_categories.site.getCategoryChildValueList() :\n for c in context.portal_categories.site.getCategoryChildValueList() :\n
context.log(\'c.getPath()\',c.getPath())\n
for vault_type in vault_type_list :\n for vault_type in vault_type_list :\n
context.log("c = %s, vault_type = %s" %(c, vault_type), "c.getvaultType = %s" %(c.getVaultType()))\n context.log("c = %s, vault_type = %s" %(c, vault_type), "c.getvaultType = %s" %(c.getVaultType()))\n
if context.portal_categories.isMemberOf(c, vault_type, strict=1) :\n if context.portal_categories.isMemberOf(c, vault_type, strict=1) :\n
...@@ -290,17 +294,20 @@ elif import_type == \'create_subvaults\' :\n ...@@ -290,17 +294,20 @@ elif import_type == \'create_subvaults\' :\n
for subvault_data in subvault_dict[vault_type] :\n for subvault_data in subvault_dict[vault_type] :\n
subvault_path = subvault_data[0]\n subvault_path = subvault_data[0]\n
subvault_code = subvault_data[1]\n subvault_code = subvault_data[1]\n
if \'Encaisse des Billets Recus pour Ventilation\' in subvault_path or \'Encaisse des Billets Restitues par Tiers a Detruire\' in subvault_path :\n if \'Encaisse des Billets Recus pour Ventilation Venant de\' in subvault_path or \'Encaisse des Billets Restitues par Tiers a Detruire\' in subvault_path \\\n
or \'Encaisse des Billets en Transit Allant a\' in subvault_path or \'Encaisse des Billets Neufs Non Emis en Transit Allant a\' in subvault_path:\n
if not context.portal_categories.isMemberOf(c, \'site/agence/principale\', strict=0) :\n if not context.portal_categories.isMemberOf(c, \'site/agence/principale\', strict=0) :\n
#print \'XXXXXXXX is not principale, not creating\', subvault_path\n print \'XXXXXXXX is not principale, not creating\', subvault_path\n
pass\n pass\n
elif subvault_path.find(\'/\') > 0 and lowerCase(subvault_path).split(\'/\')[1] in c.getRelativeUrl() :\n elif subvault_path.find(\'/\') > 0 and lowerCase(subvault_path).split(\'/\')[1] in c.getRelativeUrl() :\n
#print \'XXXXXXXX is itself, not creating\', subvault_path\n print \'XXXXXXXX is itself, not creating\', subvault_path\n
pass\n pass\n
else :\n else :\n
print \' creating\', subvault_path\n print \' creating\', subvault_path\n
if \'guichet\' in subvault_path:\n if \'guichet\' in subvault_path:\n
subcat_vault_type = \'%s/guichet\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n subcat_vault_type = \'%s/guichet\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n
elif \'transit\' in subvault_path.lower():\n
subcat_vault_type = \'%s/transit\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n
else:\n else:\n
subcat_vault_type = \'/\'.join(vault_type.split(\'/\')[1:])\n subcat_vault_type = \'/\'.join(vault_type.split(\'/\')[1:])\n
new_category_obj = create_category(cat = \'%s/%s\' % (c.getRelativeUrl(), subvault_path), vault_type = subcat_vault_type)\n new_category_obj = create_category(cat = \'%s/%s\' % (c.getRelativeUrl(), subvault_path), vault_type = subcat_vault_type)\n
...@@ -407,7 +414,7 @@ return printed\n ...@@ -407,7 +414,7 @@ return printed\n
<string>len</string> <string>len</string>
<string>e</string> <string>e</string>
<string>category</string> <string>category</string>
<string>vault_code</string> <string>acquired_vault_code</string>
<string>sub_cat</string> <string>sub_cat</string>
<string>parent_code</string> <string>parent_code</string>
<string>code</string> <string>code</string>
......
2006-05-18 aurel
* update Delivery_getVaultItemList to take new categories into account and fix Baobab_getResourceVintageList
2006-05-11 aurel 2006-05-11 aurel
* update catalog method to take getBaobabSource/DestinationVariationText into account * update catalog method to take getBaobabSource/DestinationVariationText into account
......
aurel
seb
\ 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