mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-02 08:03:21 +00:00
refactor(postgres): port Mode of Payment doctype queries to the query builder
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,12 +52,11 @@ class ModeofPayment(Document):
|
|||||||
|
|
||||||
def validate_pos_mode_of_payment(self):
|
def validate_pos_mode_of_payment(self):
|
||||||
if not self.enabled:
|
if not self.enabled:
|
||||||
pos_profiles = frappe.db.sql(
|
pos_profiles = frappe.get_all(
|
||||||
"""SELECT sip.parent FROM `tabSales Invoice Payment` sip
|
"Sales Invoice Payment",
|
||||||
WHERE sip.parenttype = 'POS Profile' and sip.mode_of_payment = %s""",
|
filters={"parenttype": "POS Profile", "mode_of_payment": self.name},
|
||||||
(self.name),
|
pluck="parent",
|
||||||
)
|
)
|
||||||
pos_profiles = list(map(lambda x: x[0], pos_profiles))
|
|
||||||
|
|
||||||
if pos_profiles:
|
if pos_profiles:
|
||||||
message = _(
|
message = _(
|
||||||
|
|||||||
Reference in New Issue
Block a user