From 9409eddf28324de1fe0ff0f2344acf859ed619d2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 Aug 2018 13:58:44 +0530 Subject: [PATCH] Update __init__.py --- erpnext/stock/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/__init__.py b/erpnext/stock/__init__.py index 331472a3f65..9895b5aaf28 100644 --- a/erpnext/stock/__init__.py +++ b/erpnext/stock/__init__.py @@ -45,10 +45,10 @@ def get_warehouse_account(warehouse, warehouse_account=None): account = account[0][0] if account else None - if not account: + if not account and warehouse.company: account = get_company_default_inventory_account(warehouse.company) return account def get_company_default_inventory_account(company): - return frappe.get_cached_value('Company', company, 'default_inventory_account') \ No newline at end of file + return frappe.get_cached_value('Company', company, 'default_inventory_account')