inventree / inventree-python

Python library for communication with inventree via API
https://docs.inventree.org/en/latest/api/python/python/
MIT License
26 stars 34 forks source link

Bom items #190

Closed DS1705 closed 1 year ago

DS1705 commented 1 year ago

is there a way to add bom items to an assembly from python code? with a BOM file or single item

T0jan commented 1 year ago

yes it is possible with the inventree.part.BomItem.create(api, data= {part, sub_part, quantity}) method. You need at least the pk of the part you want to add the bom item to, the pk of the part you want to assign and the quantity.

DS1705 commented 1 year ago

is there also away to do it with a bom file

T0jan commented 1 year ago

with a bom file you could either use the web-ui to upload it directly or you have to write yourself a python script which reads in the bom file and then uses this api to upload them.

DS1705 commented 1 year ago

okay thanks for the information