Commit 1ff25f07 authored by Aurel's avatar Aurel

many skins improvement

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7446 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cbffe030
......@@ -100,6 +100,7 @@
<list>
<string>matrixbox_membership_criterion_category_list</string>
<string>membership_criterion_base_category_list</string>
<string>matrixbox_quantity</string>
</list>
</value>
</item>
......@@ -109,7 +110,6 @@
<list>
<string>my_resource_translated_title</string>
<string>my_total_price</string>
<string>matrixbox_quantity</string>
</list>
</value>
</item>
......
......@@ -126,7 +126,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -143,7 +145,7 @@
<item>
<key> <string>editable</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -165,7 +167,7 @@
<item>
<key> <string>input_style</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
......@@ -275,12 +277,31 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getSimulationState() == \'draft\'</string> </value>
<value> <string>python: int(cell.getProperty(\'quantity\'))</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<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.getSimulationState() == \'draft\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<tuple>
......
......@@ -106,11 +106,11 @@ for line in line_list :\n
if line.hasCellContent() :\n
for cell in line.objectValues() :\n
variation_text = cell.getVariationText()\n
# context.log(\'check cell : \', str((source_counter, line_resource, variation_text)))\n
context.log(\'check cell : \', str((source_counter, line_resource, variation_text)))\n
inventory_value = context.portal_simulation.getFutureInventory(node=source_counter, resource = line_resource,\n
variation_text = variation_text)\n
# context.log(\'cell quantity\', cell.getQuantity())\n
# context.log(\'inventory value\', inventory_value)\n
context.log(\'cell quantity\', cell.getQuantity())\n
context.log(\'inventory value\', inventory_value)\n
if inventory_value - cell.getQuantity() < 0:\n
return 1\n
\n
......@@ -195,6 +195,7 @@ return 0\n
<string>line_resource</string>
<string>cell</string>
<string>variation_text</string>
<string>str</string>
<string>inventory_value</string>
</tuple>
</value>
......
......@@ -198,7 +198,6 @@ if listbox is None:\n
for currency_cash in currency_cash_list:\n
# Search if the current object contains a line with a given portal type.\n
cash_delivery_line = context.CashDelivery_searchLineByResource(currency_cash.getId(), line_portal_type)\n
#context.log("cash_delivery_line", str((cash_delivery_line, currency_cash.getTitle())))\n
# This variable counts the number of lines added for this currency cash.\n
line_number = 0\n
\n
......@@ -328,10 +327,11 @@ else :\n
listbox_line_count = len(listbox)\n
if listbox_line_count > 0:\n
listbox_line_count_plus_1 = listbox_line_count+1\n
else:\n
else: # XXX when this can happen ?\n
listbox_line_count_plus_1 = listbox_line_count\n
\n
last_row = False\n
context.log("listbox", listbox)\n
# for x in listbox :\n
for i_listbox in xrange(0,listbox_line_count_plus_1) : # Element of ListBox\n
if i_listbox < listbox_line_count:\n
......@@ -340,9 +340,10 @@ else :\n
else:\n
last_row = True\n
\n
if preview_listbox_line is None :\n
if preview_listbox_line is None : # first line\n
preview_listbox_line = listbox_line.copy()\n
elif last_row or preview_listbox_line[\'resource_id\'] <> listbox_line[\'resource_id\'] :\n
elif last_row or preview_listbox_line[\'resource_id\'] <> listbox_line[\'resource_id\']:\n
# last line or line of different resource\n
if number_line_to_add > (max_lines - number_same_line) :\n
number_line_to_add = max_lines - number_same_line\n
if number_line_to_add > 0:\n
......
......@@ -68,7 +68,7 @@
<key> <string>_body</string> </key>
<value> <string>#if context.getPortalType() == \'Container Line\' :\n
# category_list = ((\'variation\',),)\n
context.log(context.getPath(), base_category)\n
#context.log(context.getPath(), base_category)\n
if base_category != None and base_category in context.getVariationBaseCategoryList():\n
variation_list = []\n
for category_item in context.getVariationCategoryItemList():\n
......@@ -85,7 +85,7 @@ variation_category_list = context.getVariationCategoryList() #(\'emission/lette
cash_line_list = []\n
for base_category in base_category_list :\n
cash_line_list.append([x for x in context.OrderLine_getMatrixItemList(base_category) if x in variation_category_list])\n
context.log("cash line list", str((cash_line_list, base_category_list, variation_category_list, context.OrderLine_getMatrixItemList(base_category))))\n
#context.log("cash line list", str((cash_line_list, base_category_list, variation_category_list, context.OrderLine_getMatrixItemList(base_category))))\n
return cash_line_list\n
</string> </value>
</item>
......@@ -142,9 +142,9 @@ return cash_line_list\n
<string>base_category</string>
<string>base_id</string>
<string>matrixbox</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>None</string>
<string>variation_list</string>
<string>_getiter_</string>
<string>category_item</string>
......@@ -158,7 +158,6 @@ return cash_line_list\n
<string>append</string>
<string>$append0</string>
<string>x</string>
<string>str</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Container_fastInput</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string>multipart/form-data</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_resource</string>
<string>listbox_variation1</string>
<string>listbox_variation10</string>
<string>listbox_variation2</string>
<string>listbox_variation3</string>
<string>listbox_variation4</string>
<string>listbox_variation5</string>
<string>listbox_variation6</string>
<string>listbox_variation8</string>
<string>listbox_variation9</string>
<string>listbox_variation7</string>
<string>listbox_price</string>
<string>listbox_displayed_resource</string>
<string>listbox_Id_resource</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_calculated_price</string>
<string>my_test</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Container_fastInputForm</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Container_fastInputForm</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Save</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string>Container_fastInputUpdate</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_source</string>
<string>my_source_section</string>
<string>my_reference</string>
<string>my_cash_number_range_start</string>
<string>my_total_price</string>
<string>my_start_date</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_destination</string>
<string>my_destination_section</string>
<string>my_gross_weight</string>
<string>my_cash_number_range_stop</string>
<string>my_description</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Container_view</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>container_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cash Container</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -81,15 +81,20 @@ vault_inventory_dict = {}\n
vault_url = vault\n
vault_dict[vault_url] = 1\n
vault_inventory_dict[vault_url] = {}\n
inventory_kw = {}\n
inventory_kw[\'group_by_variation\'] = 1\n
if vault_report_type==\'inventory\':\n
inventory_kw[\'group_by_resource\'] = 1\n
vault_inventory_list = context.portal_simulation.getInventoryList( node_category=vault\n
#, resource_category=\'currency/\' + context.Baobab_getPortalReferenceCurrencyID()\n
, ignore_variation=0\n
,**inventory_kw\n
)\n
context.log(\'len(vault_inventory_list:\',len(vault_inventory_list))\n
for vault_inventory in vault_inventory_list:\n
context.log(\'vault_inventory total_quantity\',vault_inventory.total_quantity)\n
context.log(\'vault_inventory total_price\',vault_inventory.total_price)\n
resource = (vault_inventory.resource_uid, tuple(getVariationTitleList(vault_inventory.resource_relative_url)))\n
resource = (vault_inventory.resource_uid, vault_inventory.variation_text or \'\')\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
\n
......@@ -113,8 +118,22 @@ 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
tmp_dict = {\'resource\':resource[0], \'variation_text\':resource[1]}\n
#for resource in context.Baobab_sortResourceTitleList(resource_dict.keys()):\n
for resource in resource_dict.keys():\n
variation_text = resource[1]\n
tmp_dict = {\'resource\':resource[0], \'variation_text\':variation_text}\n
for variation in variation_text.split(\'/n\'):\n
if variation.startswith(\'cash_status\'):\n
tmp_dict[\'cash_status\'] = variation\n
elif variation.startswith(\'emission_letter\'):\n
tmp_dict[\'emission_letter\'] = variation\n
elif variation.startswith(\'variation\'):\n
tmp_dict[\'variation\'] = variation\n
tmp_dict[\'variation_title\'] = \' \'.join(getVariationTitleList(resource[1]))\n
#resource = (vault_inventory.resource_uid, tuple(getVariationTitleList(vault_inventory.variation_text or \'\')))\n
resource_value = context.portal_catalog.getObject(resource[0])\n
tmp_dict[\'base_price\'] = resource_value.getBasePrice()\n
tmp_dict[\'resource_title\'] = resource_value.getTitle()\n
general_total_price = 0\n
for vault in vault_dict.keys():\n
try:\n
......@@ -127,7 +146,15 @@ for resource in context.Baobab_sortResourceTitleList(resource_dict.keys()):\n
tmp_dict[\'general_total_price\'] = general_total_price\n
total_inventory_list.append(newTempBase(context, "new_%3i" % i, **tmp_dict))\n
i += 1\n
\n
def sort_base_price(a,b):\n
return -cmp(a.base_price,b.base_price)\n
\n
total_inventory_list.sort(sort_base_price)\n
\n
return total_inventory_list\n
\n
\n
return repr([x for x in total_inventory_list])\n
</string> </value>
</item>
......@@ -155,7 +182,7 @@ return repr([x for x in total_inventory_list])\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>vault=None,column_names=0, **kw</string> </value>
<value> <string>vault=None,vault_report_type=None,column_names=0, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -175,13 +202,14 @@ return repr([x for x in total_inventory_list])\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>vault</string>
<string>vault_report_type</string>
<string>column_names</string>
<string>kw</string>
<string>Products.ERP5Type.Document</string>
......@@ -193,23 +221,27 @@ return repr([x for x in total_inventory_list])\n
<string>vault_inventory_dict</string>
<string>vault_url</string>
<string>_write_</string>
<string>inventory_kw</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
<string>vault_inventory_list</string>
<string>len</string>
<string>_getiter_</string>
<string>vault_inventory</string>
<string>tuple</string>
<string>resource</string>
<string>_getitem_</string>
<string>column_list</string>
<string>total_inventory_list</string>
<string>i</string>
<string>variation_text</string>
<string>tmp_dict</string>
<string>variation</string>
<string>resource_value</string>
<string>general_total_price</string>
<string>resource_in_vault</string>
<string>KeyError</string>
<string>_apply_</string>
<string>sort_base_price</string>
<string>repr</string>
<string>append</string>
<string>$append0</string>
......@@ -226,6 +258,7 @@ return repr([x for x in total_inventory_list])\n
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<int>0</int>
</tuple>
......
......@@ -140,7 +140,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
<value> <string>Vault Report</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
......
......@@ -370,7 +370,7 @@
<string>Total Price</string>
</tuple>
<tuple>
<string>variation_text</string>
<string>variation_text_title</string>
<string>Variation</string>
</tuple>
<tuple>
......
......@@ -105,7 +105,7 @@
<value>
<list>
<string>my_variation_title</string>
<string>my_cash_status_title</string>
<string>my_cash_status_translated_title</string>
<string>my_emission_letter_title</string>
</list>
</value>
......
......@@ -20,7 +20,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_cash_status_title</string> </value>
<value> <string>my_cash_status_translated_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -130,9 +130,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -271,23 +269,4 @@
</dictionary>
</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.Localizer.erp5_ui.gettext(here.getCashStatusTitle())</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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