mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 21:16:46 +00:00
Merge pull request #2118 from SchrodingersGat/bom-export-fix
Fix error on BOM export (cherry picked from commit a69bcb9f184308b1feb27497f9bd426c1c481b60)
This commit is contained in:
parent
ca0caa3d2b
commit
4efa8a5d3b
@ -189,12 +189,15 @@ def ExportBom(part, fmt='csv', cascade=False, max_levels=None, parameter_data=Fa
|
||||
# Process manufacturer part
|
||||
for manufacturer_idx, manufacturer_part in enumerate(manufacturer_parts):
|
||||
|
||||
if manufacturer_part:
|
||||
if manufacturer_part and manufacturer_part.manufacturer:
|
||||
manufacturer_name = manufacturer_part.manufacturer.name
|
||||
else:
|
||||
manufacturer_name = ''
|
||||
|
||||
manufacturer_mpn = manufacturer_part.MPN
|
||||
if manufacturer_part:
|
||||
manufacturer_mpn = manufacturer_part.MPN
|
||||
else:
|
||||
manufacturer_mpn = ''
|
||||
|
||||
# Generate column names for this manufacturer
|
||||
k_man = manufacturer_headers[0] + "_" + str(manufacturer_idx)
|
||||
@ -210,12 +213,15 @@ def ExportBom(part, fmt='csv', cascade=False, max_levels=None, parameter_data=Fa
|
||||
# Process supplier parts
|
||||
for supplier_idx, supplier_part in enumerate(manufacturer_part.supplier_parts.all()):
|
||||
|
||||
if supplier_part.supplier:
|
||||
if supplier_part.supplier and supplier_part.supplier:
|
||||
supplier_name = supplier_part.supplier.name
|
||||
else:
|
||||
supplier_name = ''
|
||||
|
||||
supplier_sku = supplier_part.SKU
|
||||
if supplier_part:
|
||||
supplier_sku = supplier_part.SKU
|
||||
else:
|
||||
supplier_sku = ''
|
||||
|
||||
# Generate column names for this supplier
|
||||
k_sup = str(supplier_headers[0]) + "_" + str(manufacturer_idx) + "_" + str(supplier_idx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user