From 9ff6ccb92f1d29ee2a87e9d35e7df06917304a08 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Nov 2012 16:53:29 +0530 Subject: [PATCH] fixes in voucher import tool --- accounts/page/voucher_import_tool/voucher_import_tool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/accounts/page/voucher_import_tool/voucher_import_tool.py b/accounts/page/voucher_import_tool/voucher_import_tool.py index a597b924fa..e42e11a410 100644 --- a/accounts/page/voucher_import_tool/voucher_import_tool.py +++ b/accounts/page/voucher_import_tool/voucher_import_tool.py @@ -106,7 +106,7 @@ def import_vouchers(common_values, data, start_idx, import_type): d.company = common_values.company jv = Document("Journal Voucher") - map_fields(["voucher_type", "posting_date", "naming_series", "remarks:remark", + map_fields(["voucher_type", "posting_date", "naming_series", "remarks:user_remark", "ref_number:cheque_no", "ref_date:cheque_date", "is_opening", "amount:total_debit", "amount:total_credit", "due_date", "company"], d, jv.fields) @@ -140,6 +140,10 @@ def import_vouchers(common_values, data, start_idx, import_type): apply_cost_center_and_against_invoice(detail, d) details.append(detail) + if not details: + messages.append("""

No accounts found. + If you entered accounts correctly, please check template once

""") + return webnotes.conn.begin() doclist = DocList([jv]+details) doclist.submit()