fix: Test Cases

This commit is contained in:
Deepesh Garg
2021-01-19 17:08:18 +05:30
parent 50cd7a1650
commit 1cfb69aaae
2 changed files with 3 additions and 8 deletions

View File

@@ -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

View File

@@ -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):