Merge pull request #22657 from ruthra-kumar/keyerror_on_reports_with_subtotal

fix: keyerror on reports with subtotal
This commit is contained in:
Ankush Menat 2023-10-09 17:18:30 +05:30 committed by GitHub
commit b24d91c52f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -573,7 +573,9 @@ def get_filtered_data(ref_doctype, columns, data, user):
if match_filters_per_doctype:
for row in data:
# Why linked_doctypes.get(ref_doctype)? because if column is empty, linked_doctypes[ref_doctype] is removed
if linked_doctypes.get(ref_doctype) and shared and row[linked_doctypes[ref_doctype]] in shared:
if (
linked_doctypes.get(ref_doctype) and shared and row.get(linked_doctypes[ref_doctype]) in shared
):
result.append(row)
elif has_match(