From 2d93fe45c2c938cf7f00d97ce2eca69abde9e82a Mon Sep 17 00:00:00 2001 From: kurogeek Date: Sun, 13 Sep 2026 07:59:49 +0000 Subject: [PATCH] fix: get_payment_entry override rejected request-only args frappe.call filters kwargs to the target signature; the *args/**kwargs wrapper accepted 'cmd' and forwarded it to ERPNext's function. Mirror the original signature. --- default_thai_company/tax_withholding.py | 30 ++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/default_thai_company/tax_withholding.py b/default_thai_company/tax_withholding.py index 6afe4ee..e5c5774 100644 --- a/default_thai_company/tax_withholding.py +++ b/default_thai_company/tax_withholding.py @@ -183,9 +183,33 @@ class ThaiPaymentEntry(PaymentEntry): @frappe.whitelist() -def get_payment_entry(*args, **kwargs): - """Create > Payment from a Sales Invoice: arrive with withholding applied.""" - pe = _get_payment_entry(*args, **kwargs) +def get_payment_entry( + dt, + dn, + party_amount=None, + bank_account=None, + bank_amount=None, + party_type=None, + payment_type=None, + reference_date=None, + created_from_payment_request=False, +): + """Create > Payment from a Sales Invoice: arrive with withholding applied. + + Signature mirrors ERPNext's so `frappe.call` drops request-only args + (`cmd`, ...) instead of forwarding them. + """ + pe = _get_payment_entry( + dt, + dn, + party_amount=party_amount, + bank_account=bank_account, + bank_amount=bank_amount, + party_type=party_type, + payment_type=payment_type, + reference_date=reference_date, + created_from_payment_request=created_from_payment_request, + ) if auto_apply_customer_withholding(pe) and pe.source_exchange_rate: set_customer_withholding(pe) return pe