diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_getFastInputSaleOrderLineList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_getFastInputSaleOrderLineList.xml index dbe942bdfb96393225d0d630de6e0c6736c632e7..662d00d2682231fe8c6f7e7174ed0d38ae882f38 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_getFastInputSaleOrderLineList.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_getFastInputSaleOrderLineList.xml @@ -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> diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_setSaleOrderLineList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_setSaleOrderLineList.xml index 55bb6b13813ac86c6011af6c4bac220c56462471..65ee998b81bfd0796ea1c9995b3f49db9021697b 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_setSaleOrderLineList.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_setSaleOrderLineList.xml @@ -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 diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_updateSaleOrderLineList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_updateSaleOrderLineList.xml index 23d577f5111206177174c5752b9d7488f144ab09..410e92654f2e5e20b7e7e2dd1a96d0e92cf5eb00 100644 --- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_updateSaleOrderLineList.xml +++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_updateSaleOrderLineList.xml @@ -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 diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index bccf25b7889cc5f7b0cd7ba58f4b40ae15f65262..7f509bf3890f7334e9374d8cfb6e6d17e6a241ee 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -557 \ No newline at end of file +560 \ No newline at end of file