wolflu05 / inventree-bulk-plugin

A bulk creation plugin for InvenTree, which helps you generating locations, categories and even parts in bulk by using customized naming strategies and ensure them along your complete storage tree.
MIT License
17 stars 1 forks source link

Problem with the usage of normal strings #70

Closed nikolai2111 closed 7 months ago

nikolai2111 commented 7 months ago

Hello,

Currently, I want to use strings as dimension input, but sadly it's not working. Have I done something wrong or does this not work? Why not? Isn't this a typical use case?

grafik

wolflu05 commented 7 months ago

Hello @nikolai2111 ,

seems like strings with spaces are currently not supported in the dimension input, as the underlying regex does not detect those.

image

Seems like this change would do it. I'll publish a new version in the next days.

- (?:(?:(\w+)-(\w+))|(\*?\w+))(?:\((.*?)\))?(?:,|$)
+ (?:(?:(\w+)-(\w+))|(\*?(?:\w| )+))(?:\((.*?)\))?(?:,|$)

As a workaround for now you can use any range in the dimensions and define the strings in a list in the global context like this:

image
{"name":"","template_type":"STOCK_LOCATION","template":{"version":"1.2.2","input":{},"templates":[],"output":{"parent_name_match":"true","dimensions":["*NUMERIC"],"count":["2"],"generate":{"name":"{{global.dim1[dim.1.idx]}}"},"global_context":"{% set dim1 = [\"Flat Bar\", \"Round Bar\"] %}"}}}
nikolai2111 commented 7 months ago

Thanks for your very quick respond!

I also used the plugin at the moment and I think decimals are also not supported. Like 1, 2.2, 3.3, 4.7 ... some time it's quicker to enter the numbers by hand than calculate them via the E-series.

wolflu05 commented 7 months ago

Oh you're right, I'll also take care of that. I'll try to match everything non ,. Thanks for pointing that out.

nikolai2111 commented 7 months ago

Thanks, but this does not hurry.

wolflu05 commented 7 months ago

@nikolai2111 this is fixed now with v1.2.3 🚀

nikolai2111 commented 4 months ago

Hi @wolflu05 I am not as familiar with this topic as you are with Inventree. I just want a working system, which I have only partially succeeded because after every update of Inventree something breaks again and I can't or only partially fix it.

Would it be possible for you to help me set up a real Inventree production server, preferably bare metal in a proxmox VM that would also work with Docker.

What do you think?

wolflu05 commented 4 months ago

Hi @nikolai2111 , sorry that you have so many issues when upgrading your instance. Great that you could partially solve your issues. But to help you with the remaining, you would need to create an issue on the main repo with your detailed explanation and log output, so somebody can take a look at it.

preferably bare metal in a proxmox VM that would also work with Docker.

What do you mean by that? You can either install bare metal OR via docker. There is a guide for both (docker and bare metal) in the official docs. But I do not have enough knowledge with bare metal, as I personally run my instance via docker. I only know there were some refactoring oversights the last week with the new minior version, so the installer broke, but that should all be resolved now with 0.15.3.

nikolai2111 commented 4 months ago

Then I will create an issue in the inventree repo.

I'm still not so convinced of the Docker variant and was just looking for the best solution and in my opinion that would be bare metal, wouldn't it? Or is Docker the state-of-the-art solution? I'm just not sure if the whole thing works cleanly for me.

Sorry, I'm aware of the bare metal OR Docker, I was a bit off.

wolflu05 commented 4 months ago

I'm still not so convinced of the Docker variant and was just looking for the best solution and in my opinion that would be bare metal, wouldn't it? Or is Docker the state-of-the-art solution? I'm just not sure if the whole thing works cleanly for me.

That really depends on your personal preference. I personally like that every process is encapsulated on its own with docker, and that I can easily manage different services running like that on the same server. Also docker containers provide a known, reproducible and easy to get started environment. Installing software bare metal could lead to many side effects, e.g. you update some system dependencies, that don't work well... But at the end it's up to you, what you choose. If you only need inventree and no other services, I' probably use bare metal ???

nikolai2111 commented 3 months ago

I opened this issue on the main inventree site.

But thanks for your answers.