Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading stock item after creation and fixed form validation for 'dynamic' supplier part #936

Closed

Conversation

eeintech
Copy link
Contributor

@eeintech eeintech commented Aug 26, 2020

@SchrodingersGat I am not sure the behavior was intentional but after creating a stock item, there would be no redirect and the Stock index was shown and not updated. Instead I thought it would be better to show the newly created stock item, like it is showing the part details after a part creation.

Second thing, it looks like the new "dynamic" fields (#934) prevent form validation when reloaded and there is no further user interaction. Using the create stock item modal form, I was trying to select a Base part only and it would not validate the "supplier part". After immediately re-submitting, it would validate.
The way I fixed it was to remove the "supplier part" field from the form if user has not selected any item (eg. still at the default value ------). I am not sure what could be a better way, I tried to overwrite the "supplier part" field in the Form instance with a ModelChoiceField and the required=False argument but it still wouldn't validate...

@SchrodingersGat
Copy link
Member

@eeintech oops! I've found the issue with the ------------- option - #937

@eeintech eeintech deleted the create_stock_item_then_display branch July 14, 2021 19:10
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.

None yet

2 participants