diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 971b5e12328..7badc44971e 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, flt, cstr, comma_or, get_link_to_form, nowtime +from frappe.utils import cint, flt, cstr, get_link_to_form, nowtime from frappe import _, throw from erpnext.stock.get_item_details import get_bin_details from erpnext.stock.utils import get_incoming_rate diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index cb61b794ca8..2b3b6a9a4bc 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -74,12 +74,7 @@ class StockController(AccountsController): precision = frappe.get_precision("GL Entry", "debit_in_account_currency") for item_row in voucher_details: - if self.doctype == 'Stock Entry': - warehouse_field = 's_warehouse' - else: - warehouse_field = 'warehouse' - - sle_list = sle_map.get((item_row.name, item_row.get(warehouse_field))) + sle_list = sle_map.get(item_row.name) if sle_list: for sle in sle_list: if warehouse_account.get(sle.warehouse): @@ -223,7 +218,7 @@ class StockController(AccountsController): """, (self.doctype, self.name), as_dict=True) for sle in stock_ledger_entries: - stock_ledger.setdefault((sle.voucher_detail_no, sle.warehouse), []).append(sle) + stock_ledger.setdefault(sle.voucher_detail_no, []).append(sle) return stock_ledger def make_batches(self, warehouse_field):