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.
This commit is contained in:
2026-09-13 07:59:49 +00:00
parent 9b99be9abd
commit 2d93fe45c2
+27 -3
View File
@@ -183,9 +183,33 @@ class ThaiPaymentEntry(PaymentEntry):
@frappe.whitelist() @frappe.whitelist()
def get_payment_entry(*args, **kwargs): def get_payment_entry(
"""Create > Payment from a Sales Invoice: arrive with withholding applied.""" dt,
pe = _get_payment_entry(*args, **kwargs) 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: if auto_apply_customer_withholding(pe) and pe.source_exchange_rate:
set_customer_withholding(pe) set_customer_withholding(pe)
return pe return pe