inventree_part_import icon indicating copy to clipboard operation
inventree_part_import copied to clipboard

Feature request: Option to specify a Part IPN (IPN) to set on imported parts

Open cmidgley opened this issue 3 months ago • 9 comments

Currently, when imports create new parts the Part IPN is not set. I have a use case where setting it to the search term (SKU/MPN) would be helpful.

Use case:

My schematic uses SKU (supplier part numbers) to identify components, not MPN. This is done for a couple of reasons, one being that I use JLCPCB assembly where I use LCSC part numbers to auto-match the BOM to their assembly process, and another is it defines a specific part to use. When I import these into Inventree, the MPN is used for the Part ID and the LCSC part number is on the Supplier Part, which makes a lot of sense and is great when then running --update-recursive because it pulls in matching parts from other suppliers (fantastic for prototype parts and when not using JLCPCB assembly).

However, when I use my BOM to import parts into an assembly, none of my parts match. This is because the Part ID is MPN and the Part IPN is blank, so the BOM's use of Supplier (LCSC SKU) IDs doesn't match anything.

Proposed feature:

I propose a new option to set the Part IPN (only when creating a new part) to the SKU/MPN supplied on the import.

inventree_part_import --ipn -o lcsc C12345

Assuming that part C12345 (MPN STM32F407VGT6) hasn't been imported yet, this would set the Part IPN to "C12345" (and the part ID to "STM32F407VGT6"). This will allow a BOM import will work with either "STM32F407VGT6" (as always) as well as "C12345".

cmidgley avatar Apr 04 '24 12:04 cmidgley