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

Mass Entry of Categories and Subcategories #8166

Closed
LarryJoy opened this issue Sep 23, 2024 · 8 comments
Closed

Mass Entry of Categories and Subcategories #8166

LarryJoy opened this issue Sep 23, 2024 · 8 comments

Comments

@LarryJoy
Copy link

Body of the issue

I have a list of categories and subcategories to go with the categories. Is there a means of mass entering this information? If so, how?

@LarryJoy LarryJoy added documentation triage:not-checked Item was not checked by the core team labels Sep 23, 2024
@wolflu05
Copy link
Contributor

You can use the import tool in the admin center of platform ui for that. Then simply select the csv,excel,... table where you have all your categories and map the columns accordingly.

@LarryJoy
Copy link
Author

I don't know if that will work. I go to the Admin Center and find IMPORTER, select Data import rows, and it comes up with "Select data import row to change". This opens a box supposedly where you enter whatever data, but how does the program know where the data is supposed to go? I have a separate user name that I have for using InvenTree and I can't pull up my Libre Office Calc spreadsheet I have saved to a USB drive from my main user name. The USB drive won't download the file I have. Any suggestions along those lines?

@wolflu05
Copy link
Contributor

You can create a file like:

name,description
Electronics,Electronic parts
Mechanics,Mechanical parts

And upload it here (https://your-server/platform/settings/admin/import), and select "Part Category" as model type.

Image


I actually thought that something like this works, but after trying, I found out that this does not work. This is maybe a missing feature, e.g. see #7574 .

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

Image

@SchrodingersGat any thoughts, is this supposed to work already, or can't I reference currently importing rows by their index or a separate pk column?

@matmair matmair removed the triage:not-checked Item was not checked by the core team label Sep 24, 2024
@LarryJoy
Copy link
Author

Here is my list. Of course it can always be added to or changed:

<title></title>
<meta name="generator" content="LibreOffice 7.3.7.2 (Linux)"/>
<style type="text/css">
	body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Liberation Sans"; font-size:x-small }
	a.comment-indicator:hover + comment { background:#ffd; position:absolute; display:block; border:1px solid black; padding:0.5em;  } 
	a.comment-indicator { background:red; display:inline-block; border:1px solid black; width:0.5em; height:0.5em;  } 
	comment { display:none;  } 
</style>
Categories Definition Subcategories Definition
ASSY Assy or Subassy    
CABLEC Coaxial Cable    
CABLEW Cable Multiwire    
CABLWC Cable w/Connectors    
CAP Capacitor AXL Capacitor Axial
CAP Capacitor RAD Capacitor Radial
CAP Capacitor SMT Capacitor SMT
CHEM Chemical    
CONN Connector CONNJ Connector Jack
CONN Connector CONNP Connector Plug
DIO Diode SMT Diode SMT
DIO Diode THT Diode THT
HDWE Hardware FLTWSH Flat Washer
HDWE Hardware LOKWSH Lock Washer
HDWE Hardware NUT Machine Nut
HDWE Hardware SCREW Machine Screw
IC Integrated Circuit AUDIOAMPSMT Audio Amp SMT
IC Integrated Circuit AUDIOAMPTHT Audio Amp THT
IC Integrated Circuit DIGSMT Digital SMT
IC Integrated Circuit DIGTHT Digital THT
IC Integrated Circuit FNSMT Function SMT
IC Integrated Circuit FNTHT Function THT
IC Integrated Circuit OP-AMPSMT Op-Amp SMT
IC Integrated Circuit OP-AMPTHT Op-Amp THT
IC Integrated Circuit PROCSMT µP or µC SMT
IC Integrated Circuit PROCTHT µP or µC THT
IC Integrated Circuit VRSMT Volt Reg SMT
IC Integrated Circuit VRTHT Volt Reg THT
IND Inductor INDSMT Inductor SMT
IND Inductor INDTHT Inductor THT
LCD Liquid Crystal Display    
LED Light Emitting Diode LEDPNL LED Panel Mnt
LED Light Emitting Diode LEDSMT LED SMT
LED Light Emitting Diode LEDTHT LED THT
LEDD LED Display    
MISC Miscellaneous    
MIXER Freq Conv MIXRSM Freq Conv SMT
MIXER Freq Conv MIXRTH Freq Conv THT
MP Mechanical Part    
PCB Printed Circuit Bd    
PCBA PCB Assy    
REF Reference    
RES Resistor RESSMT Resistor SMT
RES Resistor RESTHT Resistor THT
SCH Schematic Diagram    
TOOLS Tools TOOL Tool
WIRE Wire    
XFMR Transformer XFMRSM Transformer SMT
XFMR Transformer XFMRTH Transformer THT
XSTR Transistor XSTRSM Transistor SMT
XSTR Transistor XSTRTH Transistor THT
XTAL Crystal XTALSM Crystal SMT
XTAL Crystal XTALTH Crystal THT
XTALOSC Crystal Oscillator OSCSMT XTAL Osc SMT
XTALOSC Crystal Oscillator OSCTHT XTAL Osc THT

According to the previous postings I guess that mass entry is not ready for prime time. And as far as the path given by https://your-server/platform/settings/admin/import I don't know what that means for my OS. I guess that means hand entry for now?

@SchrodingersGat
Copy link
Member

@wolflu05 using the exact same data as you pasted above, here are my results:

Image

Obviously 0 is not a valid database ID, but there was a matching category for ID 1.

Note that further work will allow "natural key" import - i.e. lookup based on other fields such as "name" (etc): #7574

@LarryJoy
Copy link
Author

That doesn't look anything like my data, and so I don't know what you are trying to show. That looks like a previous posting and doesn't make any sense to me. Thanks for replying.

@wolflu05
Copy link
Contributor

@LarryJoy To clarify, the post from SchrodingersGat was a reply to my comment from above.

I was thinking you could use the importer to import a tree of categories in mass, but was not sure why my testing was not working with some simple sample data like I expected it.

He now confirmed (he as a better understanding of the importer as he has developed it) that referencing importing rows (to build the tree - all levels at once) is not possible and will not be solved by #7574. So this is not really the solution to your problem currently as this is the essential part of your request.

The only thing which is currently possible is to import the categories "level by level" or by just creating them manually.

@LarryJoy
Copy link
Author

Okay, thank you. That answers that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants