Commit f06e3a54 authored by Mame Coumba Sall's avatar Mame Coumba Sall

2009-05-25 mame

*rename actions
*add new script to get variation title defined on item
*modified scripts used for fast input selection

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27165 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent de4bfd80
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/Order_viewAggregatedItemList</string> </value> <value> <string>string:${object_url}/Delivery_viewAggregatedItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/Order_viewAggregatedItemList</string> </value> <value> <string>string:${object_url}/Delivery_viewAggregatedItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/Order_viewAggregatedItemList</string> </value> <value> <string>string:${object_url}/Delivery_viewAggregatedItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/Order_viewAggregatedItemList</string> </value> <value> <string>string:${object_url}/Delivery_viewAggregatedItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/Order_viewAggregatedItemList</string> </value> <value> <string>string:${object_url}/Delivery_viewAggregatedItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/Order_viewAggregatedItemList</string> </value> <value> <string>string:${object_url}/Delivery_viewAggregatedItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -68,6 +68,7 @@ new_list = filter(\n ...@@ -68,6 +68,7 @@ new_list = filter(\n
result)\n result)\n
\n \n
splc_list= context.contentValues(portal_type=cell_portal_type)\n splc_list= context.contentValues(portal_type=cell_portal_type)\n
\n
if not splc_list:\n if not splc_list:\n
return new_list\n return new_list\n
for splc in splc_list:\n for splc in splc_list:\n
...@@ -75,6 +76,7 @@ for splc in splc_list:\n ...@@ -75,6 +76,7 @@ for splc in splc_list:\n
lambda x :(x.Item_getVariationCategoryList()==splc.getVariationCategoryList()),\n lambda x :(x.Item_getVariationCategoryList()==splc.getVariationCategoryList()),\n
new_list)\n new_list)\n
result_list.extend(item_list)\n result_list.extend(item_list)\n
\n
len_res_list = len(result_list)\n len_res_list = len(result_list)\n
\n \n
\n \n
......
...@@ -75,7 +75,7 @@ for line in kw.get(\'listbox\'): \n ...@@ -75,7 +75,7 @@ for line in kw.get(\'listbox\'): \n
item_list.append(item)\n item_list.append(item)\n
variation_dict = {} \n variation_dict = {} \n
for item in item_list: \n for item in item_list: \n
variation_list = item.Item_getVariationOnDefinedOnItem()\n variation_list = item.Item_getVariationCategoryTitleList()\n
if variation_list not in variation_dict:\n if variation_list not in variation_dict:\n
variation_dict[variation_list] = 0.0 \n variation_dict[variation_list] = 0.0 \n
variation_dict[variation_list] = variation_dict[variation_list] + item.getQuantity()\n variation_dict[variation_list] = variation_dict[variation_list] + item.getQuantity()\n
......
...@@ -67,7 +67,7 @@ elif context.getPortalType()==\'Inventory Line\':\n ...@@ -67,7 +67,7 @@ elif context.getPortalType()==\'Inventory Line\':\n
cell_portal_type = \'Inventory Cell\'\n cell_portal_type = \'Inventory Cell\'\n
elif context.getPortalType()==\'Internal Packing List Line\':\n elif context.getPortalType()==\'Internal Packing List Line\':\n
cell_portal_type = \'Internal Packing List Cell\'\n cell_portal_type = \'Internal Packing List Cell\'\n
context.Base_updateDialogForm(listbox=listbox)\n \n
\n \n
for line in listbox: \n for line in listbox: \n
if line["selection_check"]==1:\n if line["selection_check"]==1:\n
...@@ -76,7 +76,7 @@ for line in listbox: \n ...@@ -76,7 +76,7 @@ for line in listbox: \n
item_list.append(item)\n item_list.append(item)\n
variation_dict = {} \n variation_dict = {} \n
for item in item_list: \n for item in item_list: \n
variation_list = item.Item_getVariationOnDefinedOnItem()\n variation_list = item.Item_getVariationCategoryTitleList()\n
if variation_list not in variation_dict:\n if variation_list not in variation_dict:\n
variation_dict[variation_list] = 0.0 \n variation_dict[variation_list] = 0.0 \n
variation_dict[variation_list] = variation_dict[variation_list] + item.getQuantity()\n variation_dict[variation_list] = variation_dict[variation_list] + item.getQuantity()\n
...@@ -87,16 +87,17 @@ for splc in splc_list:\n ...@@ -87,16 +87,17 @@ for splc in splc_list:\n
variation_cell_list = \',\'.join([x[0] for x in splc.getVariationCategoryItemList()])\n variation_cell_list = \',\'.join([x[0] for x in splc.getVariationCategoryItemList()])\n
variation_cell_dict[variation_cell_list]= splc.getQuantity()\n variation_cell_dict[variation_cell_list]= splc.getQuantity()\n
final_variation_dict={}\n final_variation_dict={}\n
for key in variation_cell_dict:\n
final_variation_dict[key] = "%s/%s"%(variation_cell_dict[key],variation_dict[key])\n
\n \n
\n for key in variation_dict:\n
final_variation_dict[key] = "%s/%s"%(variation_cell_dict[key],variation_dict[key])\n
\n
\n \n
request.set(\'portal_status_message\',\n request.set(\'portal_status_message\',\n
Base_translateString(\n Base_translateString(\n
\'Quantity Defined On Packing List %s\' %(final_variation_dict)))\n \'Quantity Defined On Packing List %s\' %(final_variation_dict)))\n
\n \n
return context.SalePackingList_viewSelectItemFastInputDialog(**kw)\n context.Base_updateDialogForm(listbox=listbox)\n
return context.DeliveryLine_viewSelectItemListDialog(**kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
<string>Quantity</string> <string>Quantity</string>
</tuple> </tuple>
<tuple> <tuple>
<string>Item_getVariationOnDefinedOnItem</string> <string>Item_getVariationCategoryTitleList</string>
<string>Variation</string> <string>Variation</string>
</tuple> </tuple>
</list> </list>
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
<string>Select</string> <string>Select</string>
</tuple> </tuple>
<tuple> <tuple>
<string>Item_getVariationOnDefinedOnItem</string> <string>Item_getVariationCategoryTitleList</string>
<string>Variation</string> <string>Variation</string>
</tuple> </tuple>
</list> </list>
......
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python : cell.Item_getVariationOnDefinedOnItem()</string> </value> <value> <string>python: cell.Item_getVariationCategoryList()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.getVariationRangeCategoryItemList(display_base_category = 0)</string> </value> <value> <string>python: cell.getAggregateRelatedValue().getVariationRangeCategoryItemList(display_base_category = 0)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -305,7 +305,7 @@ ...@@ -305,7 +305,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.getVariationRangeCategoryItemList(display_base_category = 0)</string> </value> <value> <string>python: cell.getAggregateRelatedValue().getVariationRangeCategoryItemList(display_base_category = 0)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -311,7 +311,7 @@ ...@@ -311,7 +311,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>cell/Item_getVariationCategoryList</string> </value> <value> <string>cell/Item_getVariationCategoryTitleList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -53,10 +53,24 @@ ...@@ -53,10 +53,24 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if context.getPortalType() in [\'Purchase Packing List Line\',\'Inventory Line\'] and (context.getResource() and context.getResourceValue().getAggregatedPortalTypeList()) or (context.getAggregate()) or (context.getResource() is None and context.getPortalItemTypeList()):\n <value> <string>from DateTime import DateTime\n
return 0\n \n
else:\n kw[\'at_date\'] = DateTime()\n
return 1\n kw[\'item\'] = context.getRelativeUrl()\n
\n
last_affectation_list = context.portal_simulation.getCurrentTrackingList(**kw)\n
\n
if kw.get(\'src__\',0):\n
return last_affectation_list\n
if len(last_affectation_list):\n
last_affectation = last_affectation_list[0]\n
if last_affectation.delivery_uid is not None:\n
movement = context.portal_catalog.getObject(last_affectation.delivery_uid)\n
variation_list = [x[0] for x in movement.getVariationCategoryItemList()]\n
variation = \',\'.join(variation_list)\n
return variation\n
\n
return []\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -67,7 +81,7 @@ else:\n ...@@ -67,7 +81,7 @@ else:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>current=1,**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -87,15 +101,31 @@ else:\n ...@@ -87,15 +101,31 @@ else:\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>current</string>
<string>kw</string>
<string>DateTime</string>
<string>_write_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>_apply_</string>
<string>last_affectation_list</string>
<string>len</string>
<string>_getitem_</string>
<string>last_affectation</string>
<string>None</string> <string>None</string>
<string>movement</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>variation_list</string>
<string>variation</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -107,12 +137,14 @@ else:\n ...@@ -107,12 +137,14 @@ else:\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<int>1</int>
</tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>testItemDefinedOnResource</string> </value> <value> <string>Item_getVariationCategoryTitleList</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<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>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>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_history</string>
<string>listbox_quantity</string>
<string>listbox_variation_category_item_list</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</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>Order_viewAggregatedItemList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>PackingList_viewAggregatedItemList</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>Aggregated Items</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>
103 108
\ 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