2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

More fixes

- Allow stock item creation for inactive parts
- Better handling of successful stock item creation
- Disable fields rather than hiding them
This commit is contained in:
Oliver
2021-11-05 00:02:55 +11:00
parent b41dbba2b0
commit f27acde934
7 changed files with 73 additions and 22 deletions

View File

@ -25,6 +25,9 @@
*/
/* exported
clearFormInput,
disableFormInput,
enableFormInput,
hideFormInput,
setFormGroupVisibility,
showFormInput,
@ -1261,6 +1264,23 @@ function initializeGroups(fields, options) {
}
}
// Clear a form input
function clearFormInput(name, options) {
updateFieldValue(name, null, {}, options);
}
// Disable a form input
function disableFormInput(name, options) {
$(options.modal).find(`#id_${name}`).prop('disabled', true);
}
// Enable a form input
function enableFormInput(name, options) {
$(options.modal).find(`#id_${name}`).prop('disabled', false);
}
// Hide a form input
function hideFormInput(name, options) {
$(options.modal).find(`#div_id_${name}`).hide();