Skip to content

Fix disabled form item from preventing location moves for serialized stock - #927

Merged
SchrodingersGat merged 1 commit into
inventree:masterfrom
bcc:bug-serialized-move
Aug 21, 2020
Merged

SchrodingersGat merged 1 commit into
inventree:masterfrom
bcc:bug-serialized-move

Conversation

@bcc

@bcc bcc commented Aug 21, 2020

Copy link
Copy Markdown
Contributor

Stock that has serial numbers can't be moved between stock locations as the form in InvenTree/stock/templates/stock/stock_adjust.html marks the quantity control as disabled for a serialized item. The item IDs are supplied using this form component, and setting the disabled flag means those IDs are not supplied, at least by Firefox and Chromium.

To reproduce, move a serialized item between locations, and you'll get a "No items were moved" message. Checking the request details, the item name="stock-id-N" is missing, so no item is found. This works fine for stock that is not serialized.

I've removed the 'disabled' flag entirely - the max value already restricts the value from being increased above 1 and if the count is reduced to 0 then no items are moved as expected.

@SchrodingersGat

Copy link
Copy Markdown
Member

@bcc good catch, I had not considered this behaviour. Thanks for the fix, I think reverting to previous approach is the right idea here.

@SchrodingersGat
SchrodingersGat merged commit 69a3ad3 into inventree:master Aug 21, 2020
@bcc
bcc deleted the bug-serialized-move branch August 31, 2020 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants