refactor(sales_invoice): replace sql with orm in clear_unallocated_mo… (#55383)

This commit is contained in:
Loic Oberle
2026-05-29 10:28:10 +02:00
committed by GitHub
parent d4f8c033fc
commit 9b1229f4cd

View File

@@ -1034,11 +1034,7 @@ class SalesInvoice(SellingController):
def clear_unallocated_mode_of_payments(self):
self.set("payments", self.get("payments", {"amount": ["not in", [0, None, ""]]}))
frappe.db.sql(
"""delete from `tabSales Invoice Payment` where parent = %s
and amount = 0""",
self.name,
)
frappe.db.delete("Sales Invoice Payment", filters={"parent": self.name, "amount": 0})
def validate_with_previous_doc(self):
super().validate_with_previous_doc(