InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

[Importer] Allow to reference importing rows

Open wolflu05 opened this issue 1 year ago • 3 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

When importing a dataset it is not possible to reference other rows from the current dataset. This is required to import a deeply nested category tree, location tree, ... (ref: https://github.com/inventree/InvenTree/issues/8166#issuecomment-2376735397)

Suggested solution

Allow to select an extra column for the primary key of the dataset lines. Then this column can be used to lookup rows when other rows reference e.g. *1 (where the * means look for a row in the current dataset with this id.).

Example:

pk,name,parent
1,Electronic Parts1,
2,Passives,*1
3,Resistors,*2
4,Capacitors,*2
5,IC,*1
6,Mechanic Parts,

This then can be used to build a graph of data and then start by importing the root node first, then the Childs of the root node, ...

Describe alternatives you've considered

Import categories or locations "level by level"

Examples of other systems

No response

Do you want to develop this?

  • [ ] I want to develop this.

wolflu05 avatar Sep 27 '24 07:09 wolflu05

We already have a unique "row" number (within the dataset) - we could use this, perhaps?

SchrodingersGat avatar Sep 27 '24 13:09 SchrodingersGat

What column are you referring too? You mean the index of the entry in the csv file? I would argument that this is not a great idea, as then we rely on the order of the lines in the csv table. And the order may change if people manually modify the file.

wolflu05 avatar Sep 27 '24 13:09 wolflu05

Fair point!

SchrodingersGat avatar Sep 27 '24 21:09 SchrodingersGat

This issue seems stale. Please react to show this is still important.

github-actions[bot] avatar Nov 27 '24 11:11 github-actions[bot]

Not stale

SchrodingersGat avatar Nov 27 '24 11:11 SchrodingersGat