fix(perpetual inventory): Get warehouse account map only if perpetual inventory enabled (#15743)

* fix(perpetual inventory): Get warehouse account map only if perpetual inventory enabled

* fix(perpetual inventory): Get warehouse account map only if perpetual inventory enabled
This commit is contained in:
Nabin Hait
2018-10-19 18:03:13 +05:30
committed by GitHub
parent b4cf72c770
commit 5d1171678e
3 changed files with 10 additions and 7 deletions

View File

@@ -53,9 +53,9 @@ def get_warehouse_account(warehouse, warehouse_account=None):
if not account and warehouse.company:
account = get_company_default_inventory_account(warehouse.company)
if not account:
if not account and warehouse.company:
frappe.throw(_("Please set Account in Warehouse {0} or Default Inventory Account in Company {1}")
.format(warehouse, warehouse.company))
.format(warehouse.name, warehouse.company))
return account
def get_company_default_inventory_account(company):