Reduce ordered qty in Purchase Receipt based on PO warehouse

This commit is contained in:
Nabin Hait
2013-09-25 19:58:32 +05:30
parent 7496b528a1
commit 1ec5109a1a
5 changed files with 90 additions and 34 deletions

View File

@@ -59,10 +59,7 @@ class DocType:
else:
webnotes.throw(_("Please enter account group under which account \
for warehouse ") + self.doc.name +_(" will be created"))
def on_rename(self, new, old):
webnotes.conn.set_value("Account", {"account_type": "Warehouse", "master_name": old},
"master_name", new)
def merge_warehouses(self):
webnotes.conn.auto_commit_on_many_writes = 1
@@ -207,6 +204,9 @@ class DocType:
sql("delete from `tabStock Ledger Entry` where warehouse = %s", self.doc.name)
def on_rename(self, newdn, olddn, merge=False):
webnotes.conn.set_value("Account", {"account_type": "Warehouse", "master_name": olddn},
"master_name", newdn)
if merge:
from stock.stock_ledger import update_entries_after
for item_code in webnotes.conn.sql("""select item_code from `tabBin`