mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
fix: list index out of range error (#21468)
* fix: list index out of range error * fix: condition
This commit is contained in:
@@ -35,6 +35,13 @@ def execute(filters=None):
|
|||||||
})
|
})
|
||||||
return columns, data
|
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({
|
data.append({
|
||||||
"account_name": "'" + _("Included in Gross Profit") + "'",
|
"account_name": "'" + _("Included in Gross Profit") + "'",
|
||||||
"account": "'" + _("Included in Gross Profit") + "'"
|
"account": "'" + _("Included in Gross Profit") + "'"
|
||||||
|
|||||||
Reference in New Issue
Block a user