diff --git a/erpnext/patches/v7_0/set_base_amount_in_invoice_payment_table.py b/erpnext/patches/v7_0/set_base_amount_in_invoice_payment_table.py index 89ce43bfa3..5dd61a06cc 100644 --- a/erpnext/patches/v7_0/set_base_amount_in_invoice_payment_table.py +++ b/erpnext/patches/v7_0/set_base_amount_in_invoice_payment_table.py @@ -6,7 +6,8 @@ def execute(): si_list = frappe.db.sql(""" select distinct parent from `tabSales Invoice Payment` - where docstatus!=2 and amount != 0 and base_amount = 0 + where docstatus!=2 and parenttype = 'Sales Invoice' + and amount != 0 and base_amount = 0 """) count = 0 @@ -20,4 +21,4 @@ def execute(): count +=1 if count % 200 == 0: - frappe.db.commit() \ No newline at end of file + frappe.db.commit()