[fix] [minor] create account for warehouse if not exists with same name

This commit is contained in:
Nabin Hait 2013-09-25 12:50:46 +05:30
parent c5f9dcfc70
commit 373b53f222

View File

@ -32,7 +32,8 @@ class DocType:
def create_account_head(self):
if cint(webnotes.defaults.get_global_default("auto_accounting_for_stock")):
if not webnotes.conn.get_value("Account", {"account_type": "Warehouse",
"master_name": self.doc.name}):
"master_name": self.doc.name}) and not webnotes.conn.get_value("Account",
{"account_name": self.doc.warehouse_name}):
if self.doc.__islocal or not webnotes.conn.get_value("Stock Ledger Entry",
{"warehouse": self.doc.name}):
ac_bean = webnotes.bean({