Update stock_reconciliation.py

exclude 'disabled' item when get items
This commit is contained in:
ShashaQin 2016-02-01 16:54:19 +08:00
parent 1d702bf112
commit ed11e93b25

View File

@ -252,21 +252,23 @@ def get_items(warehouse, posting_date, posting_time):
items = frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse}, as_list=1) items = frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse}, as_list=1)
items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0, items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0,
"has_batch_no": 0, "has_variants": 0, "default_warehouse": warehouse}, as_list=1) "has_batch_no": 0, "has_variants": 0, "disabled": 0, "default_warehouse": warehouse}, as_list=1)
res = [] res = []
for item in set(items): for item in set(items):
stock_bal = get_stock_balance(item[0], warehouse, posting_date, posting_time, stock_bal = get_stock_balance(item[0], warehouse, posting_date, posting_time,
with_valuation_rate=True) with_valuation_rate=True)
res.append({ if frappe.db.get_value("Item",item[0],"disabled") == 0:
"item_code": item[0],
"warehouse": warehouse, res.append({
"qty": stock_bal[0], "item_code": item[0],
"valuation_rate": stock_bal[1], "warehouse": warehouse,
"current_qty": stock_bal[0], "qty": stock_bal[0],
"current_valuation_rate": stock_bal[1] "valuation_rate": stock_bal[1],
}) "current_qty": stock_bal[0],
"current_valuation_rate": stock_bal[1]
})
return res return res