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

2009-01-06 mame

*modify scripts to only display product inventory for the source section defined in the sale order

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25018 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent de54e542
......@@ -66,6 +66,7 @@ listbox = getattr(request, \'listbox\', None) \n
\n
result = []\n
line_list = context.contentValues(portal_type=\'Sale Order Line\')\n
source_section = context.getSourceSectionValue()\n
\n
len_line_list = len(line_list)\n
if len(line_list)!=0:\n
......@@ -75,9 +76,12 @@ if len(line_list)!=0:\n
quantity=line.getQuantity(),\n
quantity_unit=line.getQuantityUnit(),\n
total_price=line.getTotalPrice(),\n
getAvailableInventory=line.getResourceValue().getAvailableInventory(),\n
getCurrentInventory=line.getResourceValue().getCurrentInventory(),\n
inventory=line.getResourceValue().getInventory())\n
getAvailableInventory=line.getResourceValue().getAvailableInventory(\n
node_uid=source_section.getUid()),\n
getCurrentInventory=line.getResourceValue().getCurrentInventory(\n
node_uid=source_section.getUid()),\n
inventory=line.getResourceValue().getInventory(\n
node_uid=source_section.getUid()))\n
result.append(obj)\n
for i in range(len_line_list+1,lines_num+1):\n
obj = newTempBase(portal, id="tmp_item_%s" % i, uid="tmp_item_%s" % i)\n
......@@ -132,6 +136,7 @@ return result\n
<string>listbox</string>
<string>result</string>
<string>line_list</string>
<string>source_section</string>
<string>len</string>
<string>len_line_list</string>
<string>_getiter_</string>
......
......@@ -58,6 +58,7 @@
input information.It should take into account any sale order line \n
which were already created so that they are not duplicated.\n
"""\n
\n
result_list = []\n
sale_order_line_list = context.contentValues(portal_type=\'Sale Order Line\')\n
if sale_order_line_list!=[]:\n
......
......@@ -73,17 +73,21 @@ for line in listbox:\n
title=line[\'title\'],\n
reference=line[\'reference\'])\n
product = product_list[0]\n
if line[\'quantity\'] <= product.getAvailableInventory():\n
if line[\'quantity\'] <= product.getAvailableInventory(\n
node_uid=context.getSourceSectionValue().getUid()):\n
line_id = line[\'listbox_key\'].split(\'/erp5/\')[1]\n
line["total_price"] = line[\'quantity\'] * product.getPrice()\n
line["total_price"] = line[\'quantity\'] * product.getSaleSupplyLineBasePrice()\n
line["quantity_unit"] = product.getQuantityUnit()\n
request.form["field_listbox_reference_%s"%line_id] = product.getReference()\n
request.form["field_listbox_title_%s"%line_id] = product.getTitle()\n
request.form["field_listbox_total_price_%s"%line_id] = line[\'quantity\'] * product.getPrice()\n
request.form["field_listbox_quantity_unit_%s"%line_id] = product.getQuantityUnit()\n
request.form["field_listbox_getAvailableInventory_%s"%line_id] = product.getAvailableInventory()\n
request.form[\'field_listbox_inventory_%s\'%line_id] = product.getInventory()\n
request.form["field_listbox_getCurrentInventory_%s"%line_id] = product.getCurrentInventory()\n
request.form["field_listbox_getAvailableInventory_%s"%line_id] = product.getAvailableInventory(\n
node_uid=context.getSourceSectionValue().getUid())\n
request.form[\'field_listbox_inventory_%s\'%line_id] = product.getInventory(\n
node_uid=context.getSourceSectionValue().getUid())\n
request.form["field_listbox_getCurrentInventory_%s"%line_id] = product.getCurrentInventory(\n
node_uid=context.getSourceSectionValue().getUid())\n
request.form["field_listbox_variation_category_item_list_%s"%line_id] =\\\n
[x[0] for x in product.getVariationCategoryItemList()]\n
total_price +=line[\'total_price\']\n
......
557
\ No newline at end of file
560
\ 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