[fix] Validate if warehouse is not linked to any account

This commit is contained in:
Nabin Hait 2016-10-24 18:17:57 +05:30
parent c00b17a6e0
commit d662502f3c

View File

@ -69,6 +69,10 @@ class StockController(AccountsController):
warehouse_with_no_account.append(sle.warehouse)
if warehouse_with_no_account:
for wh in warehouse_with_no_account:
if frappe.db.get_value("Warehouse", wh, "company"):
frappe.throw(_("Warehouse {0} is not linked to any account, please create/link the corresponding (Asset) account for the warehouse.").format(wh))
msgprint(_("No accounting entries for the following warehouses") + ": \n" +
"\n".join(warehouse_with_no_account))