Commit 87f44b77 authored by Mame Coumba Sall's avatar Mame Coumba Sall

2009-05-20 mame

*add action for fast input of selection of items

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27078 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 155660d6
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_fast_input</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>select_item_fast_input</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>4.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Select Items</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SalePackingList_viewSelectItemFastInputDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object.getResource() and object.getResourceValue().getAggregatedPortalTypeList()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -67,7 +67,6 @@ elif context.getPortalType()==\'Sale Packing List Line\':\n ...@@ -67,7 +67,6 @@ elif context.getPortalType()==\'Sale Packing List Line\':\n
\n \n
movement_cell_list = context.contentValues(portal_type=cell_portal_type)\n movement_cell_list = context.contentValues(portal_type=cell_portal_type)\n
context.setVariationCategoryList([])\n context.setVariationCategoryList([])\n
context.setAggregateValueList([])\n
base_id = \'movement\'\n base_id = \'movement\'\n
for line in kw.get(\'listbox\'):\n for line in kw.get(\'listbox\'):\n
if line.has_key(\'listbox_key\') and line[\'quantity\'] in (\'\',None):\n if line.has_key(\'listbox_key\') and line[\'quantity\'] in (\'\',None):\n
......
...@@ -66,6 +66,7 @@ result_list = []\n ...@@ -66,6 +66,7 @@ result_list = []\n
new_list = filter(\n new_list = filter(\n
lambda x :(x.Item_getResourceTitle()==context.getResourceTitle()),\n lambda x :(x.Item_getResourceTitle()==context.getResourceTitle()),\n
result)\n result)\n
\n
splc_list= context.contentValues(portal_type=cell_portal_type)\n splc_list= context.contentValues(portal_type=cell_portal_type)\n
for splc in splc_list:\n for splc in splc_list:\n
item_list = filter(\n item_list = filter(\n
......
...@@ -53,10 +53,12 @@ ...@@ -53,10 +53,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>item_list = []\n <value> <string>from Products.ERP5Type.Message import translateString\n
item_list = []\n
request = context.REQUEST\n request = context.REQUEST\n
total_quantity = 0.0 \n total_quantity = 0.0 \n
new_item_list =[]\n new_item_list =[]\n
context.setAggregateValueList([])\n
type = request.get("field_my_type")\n type = request.get("field_my_type")\n
if context.getPortalType()==\'Sale Packing List Line\':\n if context.getPortalType()==\'Sale Packing List Line\':\n
cell_portal_type = \'Sale Packing List Cell\'\n cell_portal_type = \'Sale Packing List Cell\'\n
...@@ -71,17 +73,24 @@ for line in kw.get(\'listbox\'): \n ...@@ -71,17 +73,24 @@ for line in kw.get(\'listbox\'): \n
item = context.portal_catalog.getResultValue(\n item = context.portal_catalog.getResultValue(\n
relative_url=line["listbox_key"].split("erp5/")[-1])\n relative_url=line["listbox_key"].split("erp5/")[-1])\n
item_list.append(item)\n item_list.append(item)\n
\n variation_dict = {} \n
for item in item_list: \n
variation_list = item.Item_getVariationOnDefinedOnItem()\n
if variation_list not in variation_dict:\n
variation_dict[variation_list] = 0.0 \n
variation_dict[variation_list] = variation_dict[variation_list] + item.getQuantity()\n
for cell in splc_list:\n for cell in splc_list:\n
for item in item_list:\n for item in item_list:\n
if item.Item_getVariationOnMovement()==cell.getVariationCategoryList():\n if item.Item_getVariationOnMovement()==cell.getVariationCategoryList():\n
new_item_list=[]\n new_item_list=[]\n
new_item_list.append(item) \n new_item_list.append(item) \n
cell.setAggregateValueList(cell.getAggregateValueList()+new_item_list)\n cell.setAggregateValueList(context.getAggregateValueList()+ new_item_list)\n
item.setQuantity(item.getQuantity()-cell.getQuantity())\n variation_cell_list = \',\'.join([x[0] for x in cell.getVariationCategoryItemList()])\n
cell.setQuantity(variation_dict[variation_cell_list])\n
\n \n
\n \n
context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (context.absolute_url(), \'Items aggregated.\'.replace(\' \', \'%20\')))\n return context.Base_redirect(form_id, keep_items=dict(\n
portal_status_message=translateString(\'Items aggregated\')))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -92,7 +101,7 @@ context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (contex ...@@ -92,7 +101,7 @@ context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (contex
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value> <value> <string>form_id=\'view\',*args, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -112,14 +121,17 @@ context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (contex ...@@ -112,14 +121,17 @@ context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (contex
<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>form_id</string>
<string>args</string> <string>args</string>
<string>kw</string> <string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>translateString</string>
<string>item_list</string> <string>item_list</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
...@@ -134,7 +146,15 @@ context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (contex ...@@ -134,7 +146,15 @@ context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (contex
<string>line</string> <string>line</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>item</string> <string>item</string>
<string>variation_dict</string>
<string>variation_list</string>
<string>_write_</string>
<string>cell</string> <string>cell</string>
<string>append</string>
<string>$append0</string>
<string>x</string>
<string>variation_cell_list</string>
<string>dict</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -146,7 +166,9 @@ context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (contex ...@@ -146,7 +166,9 @@ context.REQUEST.response.redirect(\'%s/view?portal_status_message=%s\' % (contex
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<string>view</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
76 78
\ No newline at end of file \ No newline at end of file
...@@ -14,6 +14,7 @@ Returned Sale Packing List | aggregate_item ...@@ -14,6 +14,7 @@ Returned Sale Packing List | aggregate_item
Sale Order Line | item_creation Sale Order Line | item_creation
Sale Order | aggregate_item Sale Order | aggregate_item
Sale Packing List Line | item_creation Sale Packing List Line | item_creation
Sale Packing List Line | select_item_fast_input
Sale Packing List | aggregate_item Sale Packing List | aggregate_item
Service Report Module | view Service Report Module | view
Service Report | delivery_jump Service Report | delivery_jump
......
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