Update __init__.py

This commit is contained in:
Nabin Hait 2018-08-16 13:58:44 +05:30 committed by GitHub
parent bd06a5b0ee
commit 9409eddf28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')
return frappe.get_cached_value('Company', company, 'default_inventory_account')