From 041cea763ea9aca65c60379aa5f25db639cbdb19 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 25 May 2012 17:49:37 +0530 Subject: [PATCH] fix in stock ledger entry for items have sales bom --- erpnext/selling/doctype/sales_common/sales_common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_common/sales_common.py b/erpnext/selling/doctype/sales_common/sales_common.py index 3f6c49bb70..5975e32898 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.py +++ b/erpnext/selling/doctype/sales_common/sales_common.py @@ -352,7 +352,8 @@ class DocType(TransactionBase): if self.has_sales_bom(d.item_code): for p in getlist(obj.doclist, 'packing_details'): - if p.parent_item == d.item_code: + #if p.parent_item == d.item_code: -- this fails when item with same name appears more than once in delivery note item table + if p.parent_detail_docname == d.name: # the packing details table's qty is already multiplied with parent's qty il.append([warehouse, p.item_code, flt(p.qty), (flt(p.qty)/qty)*(reserved_qty), p.uom, p.batch_no, p.serial_no]) else: