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;