commit | 090e6093f2106d863ddb6d0bd19edf59819add16 | [log] [tgz] |
---|---|---|
author | Saqib <nextchamp.saqib@gmail.com> | Thu Apr 30 11:04:44 2020 +0530 |
committer | GitHub <noreply@github.com> | Thu Apr 30 11:04:44 2020 +0530 |
tree | 0a460cfd08d5487d133322766721fa0654a02938 | |
parent | b8d633cb4a8b1101d7a4e7c6fa64c89521c8fd33 [diff] |
fix: list index out of range error (#21467) * fix: list index out of range error * fix: condititon
diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py index 260f35f..1c45810 100644 --- a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py +++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.py
@@ -35,6 +35,12 @@ }) return columns, data + # to avoid error eg: gross_income[0] : list index out of range + if not gross_income: + gross_income = [{}] + if not gross_expense: + gross_expense = [{}] + data.append({ "account_name": "'" + _("Included in Gross Profit") + "'", "account": "'" + _("Included in Gross Profit") + "'"