[fix] fix planned qty

This commit is contained in:
Anand Doshi 2015-09-09 17:59:48 +05:30
parent f668a4d03c
commit b1454cdf9f

View File

@ -6,8 +6,9 @@ import frappe
from erpnext.stock.stock_balance import get_planned_qty, update_bin_qty from erpnext.stock.stock_balance import get_planned_qty, update_bin_qty
def execute(): def execute():
for item_code, warehouse in frappe.db.sql("""select distinct production_item, fg_warehouse for item_code, warehouse in frappe.db.sql("""select distinct production_item, fg_warehouse
from `tabProduction Order`"""): from `tabProduction Order`"""):
update_bin_qty(item_code, warehouse, { if frappe.db.exists("Item", item_code) and frappe.db.exists("Warehouse", warehouse):
"planned_qty": get_planned_qty(item_code, warehouse) update_bin_qty(item_code, warehouse, {
}) "planned_qty": get_planned_qty(item_code, warehouse)
})