Commit 614e2a31 authored by Sebastien Robin's avatar Sebastien Robin

Aurélien fixed domains

Small changes in computing exchange values
new changes in ImportCsvToCategories

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10947 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bafe6ef9
...@@ -484,6 +484,9 @@ ...@@ -484,6 +484,9 @@
<name>Edit Factories</name> <name>Edit Factories</name>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>Edit ReStructuredText</name> <name>Edit ReStructuredText</name>
<role>Manager</role> <role>Manager</role>
...@@ -686,6 +689,9 @@ ...@@ -686,6 +689,9 @@
<role>Author</role> <role>Author</role>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>View History</name> <name>View History</name>
<role>Assignee</role> <role>Assignee</role>
......
...@@ -486,6 +486,9 @@ ...@@ -486,6 +486,9 @@
<name>Edit Factories</name> <name>Edit Factories</name>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>Edit ReStructuredText</name> <name>Edit ReStructuredText</name>
<role>Manager</role> <role>Manager</role>
...@@ -689,6 +692,9 @@ ...@@ -689,6 +692,9 @@
<role>Manager</role> <role>Manager</role>
<role>Member</role> <role>Member</role>
</permission> </permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>View History</name> <name>View History</name>
<role>Assignee</role> <role>Assignee</role>
......
...@@ -475,6 +475,9 @@ ...@@ -475,6 +475,9 @@
<name>Edit Factories</name> <name>Edit Factories</name>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>Edit ReStructuredText</name> <name>Edit ReStructuredText</name>
<role>Manager</role> <role>Manager</role>
...@@ -674,6 +677,9 @@ ...@@ -674,6 +677,9 @@
<role>Author</role> <role>Author</role>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>View History</name> <name>View History</name>
<role>Assignee</role> <role>Assignee</role>
......
...@@ -484,6 +484,9 @@ ...@@ -484,6 +484,9 @@
<name>Edit Factories</name> <name>Edit Factories</name>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>Edit ReStructuredText</name> <name>Edit ReStructuredText</name>
<role>Manager</role> <role>Manager</role>
...@@ -686,6 +689,9 @@ ...@@ -686,6 +689,9 @@
<role>Manager</role> <role>Manager</role>
<role>Member</role> <role>Member</role>
</permission> </permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>View History</name> <name>View History</name>
<role>Assignee</role> <role>Assignee</role>
......
...@@ -484,6 +484,9 @@ ...@@ -484,6 +484,9 @@
<name>Edit Factories</name> <name>Edit Factories</name>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>Edit ReStructuredText</name> <name>Edit ReStructuredText</name>
<role>Manager</role> <role>Manager</role>
...@@ -686,6 +689,9 @@ ...@@ -686,6 +689,9 @@
<role>Manager</role> <role>Manager</role>
<role>Member</role> <role>Member</role>
</permission> </permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>View History</name> <name>View History</name>
<role>Assignee</role> <role>Assignee</role>
......
...@@ -484,6 +484,9 @@ ...@@ -484,6 +484,9 @@
<name>Edit Factories</name> <name>Edit Factories</name>
<role>Manager</role> <role>Manager</role>
</permission> </permission>
<permission type='list'>
<name>Edit ParsedXML</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>Edit ReStructuredText</name> <name>Edit ReStructuredText</name>
<role>Manager</role> <role>Manager</role>
...@@ -686,6 +689,9 @@ ...@@ -686,6 +689,9 @@
<role>Manager</role> <role>Manager</role>
<role>Member</role> <role>Member</role>
</permission> </permission>
<permission type='list'>
<name>View DOM hierarchy</name>
</permission>
<permission type='tuple'> <permission type='tuple'>
<name>View History</name> <name>View History</name>
<role>Assignee</role> <role>Assignee</role>
......
...@@ -381,9 +381,7 @@ ...@@ -381,9 +381,7 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <value> <string></string> </value>
<list/>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
......
...@@ -70,10 +70,9 @@ ...@@ -70,10 +70,9 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
from Products.ERP5Type.Document import newTempDomain\n
domain_list = []\n domain_list = []\n
i = 0\n i = 0\n
vault_list = context.Delivery_getVaultItemList(leaf_node=0)\n vault_list = context.Delivery_getVaultItemList(leaf_node=0, vault_type="site")\n
\n \n
# get depth\n # get depth\n
depth = len(parent.getPath().split(\'/\')[3:])\n depth = len(parent.getPath().split(\'/\')[3:])\n
...@@ -81,9 +80,12 @@ depth = len(parent.getPath().split(\'/\')[3:])\n ...@@ -81,9 +80,12 @@ depth = len(parent.getPath().split(\'/\')[3:])\n
for vault in vault_list:\n for vault in vault_list:\n
if vault[0] != \'\':\n if vault[0] != \'\':\n
if len(vault[0].split(\'/\')) == depth: \n if len(vault[0].split(\'/\')) == depth: \n
if depth > 1 and vault[0].split(\'/\')[-2] != parent.getId():\n if depth > 1:\n
# only add those from parent\n path_length = len(vault[0].split(\'/\')) - 1\n
continue\n parent_path = \'/\'.join(parent.getPath().split(\'/\')[-path_length:])\n
if \'/\'.join(vault[0].split(\'/\')[:-1]) != parent_path:\n
# only add those from parent\n
continue\n
domain = parent.generateTempDomain(id=vault[0].split(\'/\')[-1])\n domain = parent.generateTempDomain(id=vault[0].split(\'/\')[-1])\n
domain.edit(title=vault[0].split(\'/\')[-1], membership_criterion_base_category=(\'destination\',), membership_criterion_category=(\'destination/%s\' %(vault[1]),), domain_generator_method_id=script.id)\n domain.edit(title=vault[0].split(\'/\')[-1], membership_criterion_base_category=(\'destination\',), membership_criterion_category=(\'destination/%s\' %(vault[1]),), domain_generator_method_id=script.id)\n
i+=1\n i+=1\n
...@@ -100,6 +102,12 @@ return domain_list\n ...@@ -100,6 +102,12 @@ return domain_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> <value>
...@@ -143,8 +151,6 @@ return domain_list\n ...@@ -143,8 +151,6 @@ return domain_list\n
<string>depth</string> <string>depth</string>
<string>parent</string> <string>parent</string>
<string>kw</string> <string>kw</string>
<string>Products.ERP5Type.Document</string>
<string>newTempDomain</string>
<string>domain_list</string> <string>domain_list</string>
<string>i</string> <string>i</string>
<string>_getattr_</string> <string>_getattr_</string>
...@@ -154,6 +160,8 @@ return domain_list\n ...@@ -154,6 +160,8 @@ return domain_list\n
<string>_getitem_</string> <string>_getitem_</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>vault</string> <string>vault</string>
<string>path_length</string>
<string>parent_path</string>
<string>domain</string> <string>domain</string>
<string>script</string> <string>script</string>
</tuple> </tuple>
...@@ -183,4 +191,25 @@ return domain_list\n ...@@ -183,4 +191,25 @@ return domain_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>
...@@ -70,21 +70,22 @@ ...@@ -70,21 +70,22 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
from Products.ERP5Type.Document import newTempDomain\n
domain_list = []\n domain_list = []\n
i = 0\n i = 0\n
vault_list = context.Delivery_getVaultItemList(leaf_node=0)\n vault_list = context.Delivery_getVaultItemList(leaf_node=0, vault_type=\'site\')\n
\n \n
# get depth\n # get depth\n
depth = len(parent.getPath().split(\'/\')[3:])\n depth = len(parent.getPath().split(\'/\')[3:])\n
\n \n
for vault in vault_list:\n for vault in vault_list:\n
if vault[0] != \'\':\n if vault[0] != \'\':\n
context.log("vault[0]", vault[0])\n if len(vault[0].split(\'/\')) == depth:\n
if len(vault[0].split(\'/\')) == depth: \n if depth > 1:\n
if depth > 1 and vault[0].split(\'/\')[-2] != parent.getId():\n path_length = len(vault[0].split(\'/\')) - 1\n
# only add those from parent\n parent_path = \'/\'.join(parent.getPath().split(\'/\')[-path_length:])\n
continue\n if \'/\'.join(vault[0].split(\'/\')[:-1]) != parent_path:\n
# only add those from parent\n
continue\n
domain = parent.generateTempDomain(id=vault[0].split(\'/\')[-1])\n domain = parent.generateTempDomain(id=vault[0].split(\'/\')[-1])\n
domain.edit(title=vault[0].split(\'/\')[-1], membership_criterion_base_category=(\'source\',), membership_criterion_category=(\'source/%s\' %(vault[1]),), domain_generator_method_id=script.id)\n domain.edit(title=vault[0].split(\'/\')[-1], membership_criterion_base_category=(\'source\',), membership_criterion_category=(\'source/%s\' %(vault[1]),), domain_generator_method_id=script.id)\n
i+=1\n i+=1\n
...@@ -101,6 +102,12 @@ return domain_list\n ...@@ -101,6 +102,12 @@ return domain_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> <value>
...@@ -144,8 +151,6 @@ return domain_list\n ...@@ -144,8 +151,6 @@ return domain_list\n
<string>depth</string> <string>depth</string>
<string>parent</string> <string>parent</string>
<string>kw</string> <string>kw</string>
<string>Products.ERP5Type.Document</string>
<string>newTempDomain</string>
<string>domain_list</string> <string>domain_list</string>
<string>i</string> <string>i</string>
<string>_getattr_</string> <string>_getattr_</string>
...@@ -155,6 +160,8 @@ return domain_list\n ...@@ -155,6 +160,8 @@ return domain_list\n
<string>_getitem_</string> <string>_getitem_</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>vault</string> <string>vault</string>
<string>path_length</string>
<string>parent_path</string>
<string>domain</string> <string>domain</string>
<string>script</string> <string>script</string>
</tuple> </tuple>
...@@ -184,4 +191,25 @@ return domain_list\n ...@@ -184,4 +191,25 @@ return domain_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>
...@@ -75,7 +75,7 @@ if context.getDestination() is None:\n ...@@ -75,7 +75,7 @@ if context.getDestination() is None:\n
\n \n
dest_site_title = context.getDestinationValue().getSiteTitle()\n dest_site_title = context.getDestinationValue().getSiteTitle()\n
\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, base_site=context.getDestinationValue().getSite())\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", "site/surface/operations_diverses/guichet"), strict_membership=1, leaf_node=0, base_site=context.getDestinationValue().getSite())\n
# now must filter again this list to remove useless categories\n # now must filter again this list to remove useless categories\n
site_dict = {}\n site_dict = {}\n
for site in site_list:\n for site in site_list:\n
......
...@@ -437,6 +437,10 @@ ...@@ -437,6 +437,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <value>
...@@ -500,7 +504,16 @@ ...@@ -500,7 +504,16 @@
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>name</string>
<string></string>
</tuple>
<tuple>
<string>path</string>
<string></string>
</tuple>
</list>
</value> </value>
</item> </item>
</dictionary> </dictionary>
......
...@@ -296,7 +296,7 @@ ...@@ -296,7 +296,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.Delivery_getVaultItemList(vault_type=\'site\', all=1)</string> </value> <value> <string>python: here.Delivery_getVaultItemList(vault_type=\'site\', all=1,leaf_node=0)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -73,20 +73,22 @@ ...@@ -73,20 +73,22 @@
commission_ratio = context.getDiscountRatio()\n commission_ratio = context.getDiscountRatio()\n
commission_price = context.getDiscount()\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 if commission_ratio is not None and commission_ratio !=0 and commission_price is not None and commission_price !=0:\n
return None\n price = None\n
if commission_ratio == 0 or commission_price == 0:\n if commission_ratio == 0 or commission_price == 0:\n
price = round(price,0)\n price = round(price,0)\n
return price\n
if commission_ratio is None and commission_price is None:\n if commission_ratio is None and commission_price is None:\n
price = round(price,0)\n price = round(price,0)\n
return price\n
\n \n
comission_value = 0\n
if commission_ratio is not None:\n if commission_ratio is not None:\n
commission_value = commission_ratio * price\n commission_value = commission_ratio * price\n
\n \n
if commission_price is not None:\n if commission_price is not None:\n
commission_value = commission_price\n commission_value = commission_price\n
\n \n
if price is None:\n
return price\n
\n
quantity = price - commission_value\n quantity = price - commission_value\n
quantity = round(quantity,0)\n quantity = round(quantity,0)\n
if quantity!=context.getQuantity():\n if quantity!=context.getQuantity():\n
...@@ -153,6 +155,7 @@ return quantity\n ...@@ -153,6 +155,7 @@ return quantity\n
<string>commission_price</string> <string>commission_price</string>
<string>None</string> <string>None</string>
<string>round</string> <string>round</string>
<string>comission_value</string>
<string>commission_value</string> <string>commission_value</string>
<string>quantity</string> <string>quantity</string>
</tuple> </tuple>
......
...@@ -73,20 +73,22 @@ ...@@ -73,20 +73,22 @@
commission_ratio = context.getDiscountRatio()\n commission_ratio = context.getDiscountRatio()\n
commission_price = context.getDiscount()\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 if commission_ratio is not None and commission_ratio !=0 and commission_price is not None and commission_price !=0:\n
return None\n price = None\n
if commission_ratio == 0 or commission_price == 0:\n elif commission_ratio == 0 or commission_price == 0:\n
price = round(price,0)\n price = round(price,0)\n
return price\n elif commission_ratio is None and commission_price is None:\n
if commission_ratio is None and commission_price is None:\n
price = round(price,0)\n price = round(price,0)\n
return price\n
\n \n
commission_value = 0\n
if commission_ratio is not None:\n if commission_ratio is not None:\n
commission_value = commission_ratio * price\n commission_value = commission_ratio * price\n
\n \n
if commission_price is not None:\n if commission_price is not None:\n
commission_value = commission_price\n commission_value = commission_price\n
\n \n
if price is None:\n
return price\n
\n
quantity = price + commission_value\n quantity = price + commission_value\n
quantity = round(quantity,0)\n quantity = round(quantity,0)\n
if quantity!=context.getQuantity():\n if quantity!=context.getQuantity():\n
......
...@@ -68,15 +68,14 @@ ...@@ -68,15 +68,14 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string># return context.getMovementList(portal_type=portal_type)\n
# return context.getMovementList(portal_type=portal_type)\n
# here we suppose we have only two level of portal type\n # here we suppose we have only two level of portal type\n
#context.log("Delivery_getMovementList", "portal_type = %s" %(portal_type,))\n #context.log("Delivery_getMovementList", "portal_type = %s" %(portal_type,))\n
#context.log("Delivery_getMovementList", "len portal_type = %s" % (len(portal_type),))\n
\n \n
if not same_type(portal_type, []):\n if not same_type(portal_type, []):\n
return context.getMovementList(portal_type=portal_type)\n return context.getMovementList(portal_type=portal_type)\n
if len(portal_type) > 2 or len(portal_type) == 0:\n if len(portal_type) != 2:\n
# use catalog\n # use catalog\n
return context.getMovementList(portal_type=portal_type)\n return context.getMovementList(portal_type=portal_type)\n
\n \n
...@@ -99,9 +98,7 @@ for line in line_list:\n ...@@ -99,9 +98,7 @@ for line in line_list:\n
cell_list.extend(list(line.objectValues(portal_type=cell_type)))\n cell_list.extend(list(line.objectValues(portal_type=cell_type)))\n
\n \n
return cell_list\n return cell_list\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
......
...@@ -180,6 +180,7 @@ elif import_type == \'assign_codification\' :\n ...@@ -180,6 +180,7 @@ elif import_type == \'assign_codification\' :\n
if len(e_list) == 2 :\n if len(e_list) == 2 :\n
try :\n try :\n
print \'trying to assign to %s ...\' % lowerCase(e_list[0]) ,\n print \'trying to assign to %s ...\' % lowerCase(e_list[0]) ,\n
context.log(\'lowerCase(e_list[0])\',lowerCase(e_list[0]))\n
category = context.portal_categories.getCategoryValue(lowerCase(e_list[0]))\n category = context.portal_categories.getCategoryValue(lowerCase(e_list[0]))\n
category.setCodification(e_list[1])\n category.setCodification(e_list[1])\n
# Automatically assign code for some subcategories\n # Automatically assign code for some subcategories\n
...@@ -258,7 +259,9 @@ elif import_type == \'create_subvaults\' :\n ...@@ -258,7 +259,9 @@ elif import_type == \'create_subvaults\' :\n
if counter_name in two_way_counter_list:\n if counter_name in two_way_counter_list:\n
subvault_dict[vault].append([\'%s/%s\' % (counter_subvault, "entrante"), None])\n subvault_dict[vault].append([\'%s/%s\' % (counter_subvault, "entrante"), None])\n
subvault_dict[vault].append([\'%s/%s\' % (counter_subvault, "sortante"), None])\n subvault_dict[vault].append([\'%s/%s\' % (counter_subvault, "sortante"), None])\n
if subvault == \'Encaisse des Devises\' :\n elif subvault == \'Encaisse des Externes\' :\n
subvault_dict[vault].append([\'%s/%s\' % (counter_subvault, "transit"), \'TRA\'])\n
elif subvault == \'Encaisse des Devises\' :\n
for c in context.currency_module.objectValues() :\n for c in context.currency_module.objectValues() :\n
if c.getId() != context.Baobab_getPortalReferenceCurrencyID():\n if c.getId() != context.Baobab_getPortalReferenceCurrencyID():\n
if counter_name in two_way_counter_list:\n if counter_name in two_way_counter_list:\n
...@@ -268,7 +271,7 @@ elif import_type == \'create_subvaults\' :\n ...@@ -268,7 +271,7 @@ 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 in (\'Encaisse des Billets Recus pour Ventilation Venant de\',\'Encaisse des Billets en Transit Allant a\',\n elif 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 \'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
...@@ -292,6 +295,8 @@ elif import_type == \'create_subvaults\' :\n ...@@ -292,6 +295,8 @@ elif import_type == \'create_subvaults\' :\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.getCategoryChildValueList() :\n
#for c in context.portal_categories.site.agence.principale.lome.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.agence.principale.cotonou.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 context.log(\'c.getPath()\',c.getPath())\n
for vault_type in vault_type_list :\n for vault_type in vault_type_list :\n
...@@ -325,6 +330,16 @@ elif import_type == \'create_subvaults\' :\n ...@@ -325,6 +330,16 @@ elif import_type == \'create_subvaults\' :\n
subcat_vault_type = \'%s/guichet\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n subcat_vault_type = \'%s/guichet\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n
elif \'retire\' in subvault_path.lower():\n elif \'retire\' in subvault_path.lower():\n
subcat_vault_type = \'%s/retire\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n subcat_vault_type = \'%s/retire\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n
elif subvault_path.lower().endswith(\'externes\'):\n
subcat_vault_type = \'%s/encaisse_des_externes\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n
elif subvault_path.lower().endswith(\'transit\'):\n
subcat_vault_type = \'%s/encaisse_des_externes/transit\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n
elif \'devises\' in subvault_path.lower():\n
subcat_vault_type = \'%s/encaisse_des_devises\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n
elif \'mutiles\' in subvault_path.lower():\n
subcat_vault_type = \'%s/billets_mutiles\' %(\'/\'.join(vault_type.split(\'/\')[1:]),)\n
elif \'macules\' in subvault_path.lower():\n
subcat_vault_type = \'%s/billets_macules\' %(\'/\'.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
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Stopped (Check)</string> </value> <value> <string>Cancelled (Check)</string> </value>
</item> </item>
<item> <item>
<key> <string>transitions</string> </key> <key> <string>transitions</string> </key>
......
29 42
\ 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