From 52403c537ba61094d7c8e2baf4eb84b85ef589fe Mon Sep 17 00:00:00 2001 From: walstanb Date: Sat, 27 Mar 2021 10:13:27 +0530 Subject: [PATCH] fix: check if gst account exists before appending --- erpnext/regional/india/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index e24bd6c3d07..0a2cf489ad8 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -823,8 +823,11 @@ def get_regional_round_off_accounts(company, account_list): return gst_accounts = get_gst_accounts(company) - gst_account_list = gst_accounts.get('cgst_account') + gst_accounts.get('sgst_account') \ - + gst_accounts.get('igst_account') + + gst_account_list = [] + for account in ['cgst_account', 'sgst_account', 'igst_account']: + if account in gst_accounts.keys(): + gst_account_list += gst_accounts.get(account) account_list.extend(gst_account_list)