Include part number info in BOM table
This commit is contained in:
parent
3b048ba77f
commit
af230a4a5c
@ -68,7 +68,7 @@ def pn_info_string(
|
|||||||
|
|
||||||
|
|
||||||
def print_bom_debug(bom):
|
def print_bom_debug(bom):
|
||||||
headers = "# qty unit description amount unit designators category".split(" ")
|
headers = "# qty unit description amount unit designators category pn manufacturer mpn supplier spn".split(" ")
|
||||||
rows = []
|
rows = []
|
||||||
rows.append(headers)
|
rows.append(headers)
|
||||||
# fill rows
|
# fill rows
|
||||||
@ -83,6 +83,16 @@ def print_bom_debug(bom):
|
|||||||
", ".join(sorted(entry["designators"])),
|
", ".join(sorted(entry["designators"])),
|
||||||
f"{entry['category']} ({entry['category'].name})",
|
f"{entry['category']} ({entry['category'].name})",
|
||||||
]
|
]
|
||||||
|
if hash.partnumbers:
|
||||||
|
cells.extend([
|
||||||
|
hash.partnumbers.pn,
|
||||||
|
hash.partnumbers.manufacturer,
|
||||||
|
hash.partnumbers.mpn,
|
||||||
|
hash.partnumbers.supplier,
|
||||||
|
hash.partnumbers.spn,
|
||||||
|
])
|
||||||
|
else:
|
||||||
|
cells.extend([None,None,None,None,None])
|
||||||
rows.append(cells)
|
rows.append(cells)
|
||||||
# remove empty columns
|
# remove empty columns
|
||||||
transposed = list(map(list, zip(*rows)))
|
transposed = list(map(list, zip(*rows)))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user