InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

[FR] Add "Create another location after this one" in add stock location form

Open spamik opened this issue 3 months ago • 7 comments

Please verify that this feature request has NOT been suggested before.

  • [x] I checked and didn't find a similar feature request

Problem statement

In the old 0.17 UI in form for creating new stock location was option named "Create another location after this one." When I checked this option, after submitting form with Add button, the stock location was created but the form remains opened with all filled relevant options and form focus was changed to location name. So if I wanted to create several stock locations just with a little bit different name, I was only changing the name and issuing form with enter key again and again. Now the form close and the new stock location is opened, so I have to go back, open form again, fill all thing again and it takes much more time.

Suggested solution

Add this option with same function as it was in the old UI.

Describe alternatives you've considered

Or any other way how to bulk create more stock locations at once.

Examples of other systems

No response

Do you want to develop this?

  • [ ] I want to develop this.

spamik avatar Sep 27 '25 10:09 spamik

@spamik would you be willing to develop this?

SchrodingersGat avatar Sep 30 '25 02:09 SchrodingersGat

Well, I would like to, I'm just not sure if I can do it with my very little experience with React :-)

spamik avatar Sep 30 '25 11:09 spamik

What better way to learn? Happy to help point you in the right direction.

Whatever we implement, I would like it to be generic, such as a keepFormOpen option which can be applied to any of these form types

SchrodingersGat avatar Oct 01 '25 03:10 SchrodingersGat

Ok, maybe the first very stupid question. Is there any way how to connect form locally running frontend instance to existing server? I've successfully run frontend on my workstation. But when I try to log in to some running inventree server instance (I've tried my instance and demo server, both with same result) I got login failed error. In browser console I can see these errors:

Image

So I guess there is some other authorization mechanism so only permitted client(frontend) can access the server?

spamik avatar Oct 02 '25 15:10 spamik

Well, I've added localhost to INVENTREE_TRUSTED_ORIGINS on my running server instance. But now it still fails with CSRF missing cookie error. I suppose that the reason is that frontend app won't send CSRF cookie when server is running on another domain so I probably have to run also backend instance on development workstation to get running for testing I guess?

spamik avatar Oct 02 '25 15:10 spamik

@spamik are you using the devcontainer setup for development and testing?

  • https://docs.inventree.org/en/stable/develop/devcontainer/

SchrodingersGat avatar Oct 02 '25 21:10 SchrodingersGat

Nope, but I've already find it in the documentation. Never worked with devcontainer also (just with docker) but I'll try that :-) Thanks

spamik avatar Oct 03 '25 10:10 spamik