frappe/frappe#478, fixed list passed in

This commit is contained in:
Rushabh Mehta
2014-04-04 12:16:26 +05:30
parent 558a9aabfb
commit a504f0638b
14 changed files with 61 additions and 65 deletions

View File

@@ -40,16 +40,15 @@ def get_latest_stock_balance():
def get_bin(item_code, warehouse):
bin = frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse})
if not bin:
bin_wrapper = frappe.get_doc([{
bin_obj = frappe.get_doc({
"doctype": "Bin",
"item_code": item_code,
"warehouse": warehouse,
}])
bin_wrapper.ignore_permissions = 1
bin_wrapper.insert()
bin_obj = bin_wrapper.make_controller()
})
bin_obj.ignore_permissions = 1
bin_obj.insert()
else:
bin_obj = frappe.get_doc('Bin', bin)
bin_obj = frappe.get_doc('Bin', bin)
return bin_obj
def update_bin(args):