From 373b53f2223a4eaa243ce6e49d0c2e462106b155 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 25 Sep 2013 12:50:46 +0530 Subject: [PATCH] [fix] [minor] create account for warehouse if not exists with same name --- stock/doctype/warehouse/warehouse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stock/doctype/warehouse/warehouse.py b/stock/doctype/warehouse/warehouse.py index eb84acf1e6a..ee4cfbc59f2 100644 --- a/stock/doctype/warehouse/warehouse.py +++ b/stock/doctype/warehouse/warehouse.py @@ -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({