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:
@ -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();
|
||||
|
Reference in New Issue
Block a user