Part-DB-server icon indicating copy to clipboard operation
Part-DB-server copied to clipboard

Make the ID editable or add IPN (Internal Part Number)

Open zanna-37 opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. I keep track of items with an internal part number which should be modifiable and searchable.

Describe the solution you'd like It would be amazing if the ID could be manually modified. Alternatively, a unique indexed field (e.g. IPN - Internal Part Number) would work.

Describe alternatives you've considered Stick with the generated ID =(

zanna-37 avatar Aug 09 '22 09:08 zanna-37

The database ID is used to identify the relations between the different entities (and is even create by the database server itself when a new entry is created). When you can change it, this will most breaking the numbering system and relationship between entities. Also the ID value is restricted to a single number, which i guess is not really useful.

An text field representing an user provided internal ID is possible however (and it will behave like any other field of the part). I am interested however what is your use case for this?

jbtronics avatar Aug 09 '22 11:08 jbtronics

@zanna-37 Use the tag for your IPN? It is searchable

jagauthier avatar Aug 09 '22 11:08 jagauthier

@jagauthier Doable, yes, but it isn't guaranteed to be unique. On top, I would generate a ton of tags that make the use of real tags inconvenient because their are overwhelmed by IPN.

zanna-37 avatar Aug 09 '22 13:08 zanna-37

@jbtronics I assumed the db is able to handle the modification with cascade. By the way, a number would be enough, but it should be unique and searchable, and the ID has both of these requirements for free.

the use case is that I mark every item with a number, to manage my inventory, but I would like it decide the value, or change it in the future. A real example is that I may put a note on an item with the following text: You can find the instruction manual of this item in # 11. You can use the charger # 42, and for the cable use # 69.

zanna-37 avatar Aug 09 '22 13:08 zanna-37

There is now an Internal Part number field in the advanced section of a part, which can be used for this usecase.

jbtronics avatar Dec 05 '22 21:12 jbtronics

Thank you very much! However, important characteristics, in my opinion, are that the IPN should be unique and searchable. Are these two conditions respected?

On top of that, it would be nice to have a way to autogenerate the next available IPN (similar to auto-increment behavior).

zanna-37 avatar Dec 07 '22 09:12 zanna-37

The IPN are ensured to be unique across all parts. That is ensured by a unique database on database level and a check in the software, which shows an error message if you want to save an already exisiting IPN to another part. You can search/filter by the IPN via the filter system (there is now a new IPN filter).

The IPN is a generic text field, too be as generic as possible and to support all naming schemes somebody could want.

However this makes it very difficult until impossible to implement a next-available IPN feature, as predicting the next IPN for all possible formats is not really possible (whats the next free number for a IPN like "1234-A-53" or so?).

jbtronics avatar Dec 07 '22 14:12 jbtronics

It will suffice. =) Thank you very very much for everything.

zanna-37 avatar Dec 15 '22 08:12 zanna-37