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

2009-05-19 mame

*modified script to create items even if only reference or title is defined

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27066 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 49821c11
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
item_list = []\n item_list = []\n
request = context.REQUEST\n request = context.REQUEST\n
total_quantity = 0.0\n total_quantity = 0.0\n
type = request.get("field_my_type")\n type = request.get("field_your_type")\n
if context.getPortalType()==\'Purchase Packing List Line\':\n if context.getPortalType()==\'Purchase Packing List Line\':\n
cell_portal_type = \'Purchase Packing List Cell\'\n cell_portal_type = \'Purchase Packing List Cell\'\n
elif context.getPortalType()==\'Purchase Order Line\' :\n elif context.getPortalType()==\'Purchase Order Line\' :\n
...@@ -70,10 +70,12 @@ context.setVariationCategoryList([])\n ...@@ -70,10 +70,12 @@ context.setVariationCategoryList([])\n
context.setAggregateValueList([])\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 not (line[\'title\']):\n if line.has_key(\'listbox_key\') and line[\'quantity\'] in (\'\',None):\n
continue\n request.set(\'portal_status_message\', \n
module = context.getDefaultModule(\'Item\')\n Base_translateString(\'Please Define Quantity for Item Defined On Line %s\'%line[\'listbox_key\']))\n
item = module.newContent(portal_type=\'Item\',\n if line.has_key(\'listbox_key\') and (line[\'title\'] or line[\'reference\'] not in (\'\', None)):\n
module = context.getDefaultModule(type)\n
item = module.newContent(portal_type=type,\n
title=line[\'title\'],\n title=line[\'title\'],\n
reference=line[\'reference\'],\n reference=line[\'reference\'],\n
quantity=line[\'quantity\'])\n quantity=line[\'quantity\'])\n
...@@ -158,6 +160,8 @@ return context.Base_redirect(form_id, keep_items=dict(\n ...@@ -158,6 +160,8 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<string>_getiter_</string> <string>_getiter_</string>
<string>line</string> <string>line</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>None</string>
<string>Base_translateString</string>
<string>module</string> <string>module</string>
<string>item</string> <string>item</string>
<string>append</string> <string>append</string>
...@@ -166,7 +170,6 @@ return context.Base_redirect(form_id, keep_items=dict(\n ...@@ -166,7 +170,6 @@ return context.Base_redirect(form_id, keep_items=dict(\n
<string>len</string> <string>len</string>
<string>i</string> <string>i</string>
<string>list</string> <string>list</string>
<string>None</string>
<string>cell_key</string> <string>cell_key</string>
<string>quantity</string> <string>quantity</string>
<string>_apply_</string> <string>_apply_</string>
......
74 76
\ 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