This commit is contained in:
Anand Doshi 2013-01-14 15:46:17 +05:30
parent 39a3c03b62
commit c313d662df
2 changed files with 7 additions and 3 deletions

View File

@ -219,7 +219,9 @@ class DocType:
if args.get("warehouse"):
args["warehouse_type"] = webnotes.conn.get_value('Warehouse' , args["warehouse"],
'warehouse_type')
sle = webnotes.model_wrapper([args]).insert()
sle = webnotes.model_wrapper([args])
sle.ignore_permissions = 1
sle.insert()
return sle.doc.name
def repost(self):

View File

@ -89,11 +89,13 @@ def update_entries_after(args, verbose=1):
# update bin
if not webnotes.conn.exists({"doctype": "Bin", "item_code": args["item_code"],
"warehouse": args["warehouse"]}):
webnotes.model_wrapper([{
bin_wrapper = webnotes.model_wrapper([{
"doctype": "Bin",
"item_code": args["item_code"],
"warehouse": args["warehouse"],
}]).insert()
}])
bin_wrapper.ignore_permissions = 1
bin_wrapper.insert()
webnotes.conn.sql("""update `tabBin` set valuation_rate=%s, actual_qty=%s,
stock_value=%s,