fix: list index out of range error (#21467)

* fix: list index out of range error

* fix: condititon
This commit is contained in:
Saqib
2020-04-30 11:04:44 +05:30
committed by GitHub
parent b8d633cb4a
commit 090e6093f2

View File

@@ -35,6 +35,12 @@ def execute(filters=None):
})
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") + "'"