File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,7 @@ protected function _getJs($quantityFieldId, $inStockFieldId)
188
188
' {$ inStockFieldId }': 'inventory_stock_availability'
189
189
};
190
190
191
+ var qtyDefaultValue = qty.val();
191
192
var disabler = function(event) {
192
193
if (typeof(event) === 'undefined') {
193
194
return;
@@ -197,8 +198,13 @@ protected function _getJs($quantityFieldId, $inStockFieldId)
197
198
if (stockBeforeDisable.result !== false) {
198
199
var manageStockValue = {$ isNewProduct }
199
200
? (qty.val() === '' ? 0 : 1)
200
- : parseInt(manageStockField.val()),
201
- stockAssociations = $('#' + fieldsAssociations[' {$ inStockFieldId }']);
201
+ : parseInt(manageStockField.val());
202
+ if ( {$ isNewProduct } && qtyDefaultValue !== null && qtyDefaultValue === qty.val()) {
203
+ manageStockValue = parseInt(manageStockField.val());
204
+ } else {
205
+ qtyDefaultValue = null;
206
+ }
207
+ var stockAssociations = $('#' + fieldsAssociations[' {$ inStockFieldId }']);
202
208
stockAvailabilityField.prop('disabled', !manageStockValue);
203
209
stockAssociations.prop('disabled', !manageStockValue);
204
210
if ($(event.currentTarget).attr('id') === qty.attr('id') && event.type != 'change') {
You can’t perform that action at this time.
0 commit comments