From d11e32ac6500e4db3e3eaaf07ba3f9a528171ed1 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Wed, 15 Jul 2026 15:57:56 +0000 Subject: [PATCH] fix(vat): don't enter fill mode unless call completion is observable Guard the frappe.call wrapper: only bump the pending counter / set fill mode when the call actually returns a thenable. Otherwise a non-promise return would leave fill mode stuck on and silently stop every recompute. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../declaration_of_value_added_tax.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/taxes_az/taxes_az/doctype/declaration_of_value_added_tax/declaration_of_value_added_tax.js b/taxes_az/taxes_az/doctype/declaration_of_value_added_tax/declaration_of_value_added_tax.js index 246f512..794cf66 100644 --- a/taxes_az/taxes_az/doctype/declaration_of_value_added_tax/declaration_of_value_added_tax.js +++ b/taxes_az/taxes_az/doctype/declaration_of_value_added_tax/declaration_of_value_added_tax.js @@ -300,9 +300,11 @@ if (!frappe.__vc_call_wrapped) { frappe.call = function (opts) { var m = (opts && opts.method) || (typeof opts === "string" ? opts : ""); var fill = VC.re.test(m || ""); - if (fill) { VC.n++; VC.mode = true; } var ret = _vc_call.apply(this, arguments); + // Only enter fill mode if we can also observe completion — otherwise mode would + // stick on forever and stop every recompute. if (fill && ret && typeof ret.then === "function") { + VC.n++; VC.mode = true; var done = function () { if (--VC.n > 0) return; // other fill calls still running VC.n = 0;