diff --git a/frappe/__init__.py b/frappe/__init__.py index 1f4e37c3d0..cd2d985191 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template -__version__ = '8.3.3' +__version__ = '8.3.4' __title__ = "Frappe Framework" local = Local() diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index b1d765aaf8..854f04369a 100755 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -129,7 +129,7 @@ frappe.ui.form.Control = Class.extend({ }; value = this.validate(value); - if (value.then) { + if (value && value.then) { // got a promise return value.then((value) => set(value)); } else { diff --git a/frappe/public/js/frappe/form/script_manager.js b/frappe/public/js/frappe/form/script_manager.js index 97663eb0d7..fce960e0d9 100644 --- a/frappe/public/js/frappe/form/script_manager.js +++ b/frappe/public/js/frappe/form/script_manager.js @@ -101,11 +101,21 @@ frappe.ui.form.ScriptManager = Class.extend({ // make list of functions to be run serially handlers.new_style.forEach((_function) => { - tasks.push(() => runner(_function, false)); + if(event_name==='setup') { + // setup must be called immediately + runner(_function, false); + } else { + tasks.push(() => runner(_function, false)); + } }); handlers.old_style.forEach((_function) => { - tasks.push(() => runner(_function, true)); + if(event_name==='setup') { + // setup must be called immediately + runner(_function, false); + } else { + tasks.push(() => runner(_function, true)); + } }); // run them serially @@ -147,7 +157,7 @@ frappe.ui.form.ScriptManager = Class.extend({ if(doctype.__custom_js) { try { - eval(doctype.__custom_js) + eval(doctype.__custom_js); } catch(e) { frappe.msgprint({ title: __('Error in Custom Script'),