From c55c77f4e9c48bbebe36cfc29ffbebde2b5bbaaa Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Tue, 8 Apr 2025 20:40:50 +0200 Subject: [PATCH] fix: recognize trigger from child table --- erpnext/public/js/controllers/transaction.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 99731f20359..4b088c8054f 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1042,9 +1042,14 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe } } - due_date(doc) { + due_date(doc, cdt) { // due_date is to be changed, payment terms template and/or payment schedule must // be removed as due_date is automatically changed based on payment terms + if (doc.doctype !== cdt) { + // triggered by change to the due_date field in payment schedule child table + // do nothing to avoid infinite clearing loop + return; + } // if there is only one row in payment schedule child table, set its due date as the due date if (doc.payment_schedule.length == 1){