Skip to content

Manufacturer name in Part/Stock item label #2983

Answered by SchrodingersGat
opcod3 asked this question in Q&A
Discussion options

You must be logged in to vote

The ManufacturerPart model links between a Part and Company (manufacturer) instance in the database.

From the context of a Part you could iterate through the linked ManufacturerPart items:

{% for mp in part.manufacturer_parts.all %}
<!-- do something here -->
{% endif %}

But it really depends on exactly what you are trying to do.

I think it sounds more likely that you are looking to label a StockItem rather than a Part? In this case, each StockItem instance can link directly to a SupplierPart which can in turn reference a ManufacturerPart.

So, if you are printing a label for a StockItem, within that context you could do something like:

Manufacturer: {{ stock_item.supplier_part.manufactur…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@SchrodingersGat
Comment options

@matmair
Comment options

@opcod3
Comment options

@matmair
Comment options

@opcod3
Comment options

Answer selected by opcod3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants