diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js index 904053a423..292b1d89ad 100644 --- a/InvenTree/templates/js/translated/forms.js +++ b/InvenTree/templates/js/translated/forms.js @@ -258,6 +258,8 @@ function constructForm(url, options) { constructFormBody({}, options); } + options.fields = options.fields || {}; + // Save the URL options.url = url; @@ -517,6 +519,11 @@ function constructFormBody(fields, options) { initializeGroups(fields, options); + if (options.afterRender) { + // Custom callback function after form rendering + options.afterRender(fields, options); + } + // Scroll to the top $(options.modal).find('.modal-form-content-wrapper').scrollTop(0); }