From 087da2e5719234af9c5b9944876d73e24929e6cf Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Fri, 14 Jul 2017 17:44:26 +0530 Subject: [PATCH] Fixed patch (#9862) (#9871) --- .../fix_nonwarehouse_ledger_gl_entries_for_transactions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py b/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py index d0e816a1a2..2b92b17f11 100644 --- a/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py +++ b/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py @@ -7,10 +7,11 @@ import frappe, erpnext def execute(): frappe.reload_doctype("Account") - warehouses = frappe.db.sql_list("""select name, company from tabAccount + warehouses = frappe.db.sql("""select name, company from tabAccount where account_type = 'Stock' and is_group = 0 - and (warehouse is null or warehouse = '')""", as_dict) + and (warehouse is null or warehouse = '')""", as_dict=1) warehouses = [d.name for d in warehouses if erpnext.is_perpetual_inventory_enabled(d.company)] + if len(warehouses) > 0: warehouses = set_warehouse_for_stock_account(warehouses) if not warehouses: