fix: SQL query in accounts receivable, payable reports (#22888)

This commit is contained in:
Rucha Mahabal 2020-08-03 20:41:25 +05:30 committed by GitHub
parent e211bb7a53
commit b7311c8fc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -643,8 +643,10 @@ class ReceivablePayableReport(object):
account_type = "Receivable" if self.party_type == "Customer" else "Payable"
accounts = [d.name for d in frappe.get_all("Account",
filters={"account_type": account_type, "company": self.filters.company})]
conditions.append("account in (%s)" % ','.join(['%s'] *len(accounts)))
values += accounts
if accounts:
conditions.append("account in (%s)" % ','.join(['%s'] *len(accounts)))
values += accounts
def add_customer_filters(self, conditions, values):
if self.filters.get("customer_group"):