update for default warehouse

This commit is contained in:
Manas Solanki
2018-05-04 16:02:38 +05:30
parent c760222a6c
commit 087a2259d9
17 changed files with 223 additions and 97 deletions

View File

@@ -216,8 +216,9 @@ class BuyingController(StockController):
raw_materials_cost = 0
items = list(set([d.item_code for d in bom_items]))
item_wh = frappe._dict(frappe.db.sql("""select item_code, default_warehouse
from `tabItem` where name in ({0})""".format(", ".join(["%s"] * len(items))), items))
item_wh = frappe._dict(frappe.db.sql("""select i.item_code, id.default_warehouse
from `tabItem` i, `tabItem Default` id where id.company=%s and i.name in ({0})"""
.format(", ".join(["%s"] * len(items))), [self.company] + items))
for bom_item in bom_items:
if self.doctype == "Purchase Order":