Skip to content
Discussion options

You must be logged in to vote

@gunstr this is because, when merging reports, each entry in the list is a dictionary object, where each object is an instance of this dict:

https://docs.inventree.org/en/stable/report/context_variables/#purchase-order

So, each "instance" has a variable named "order" within it, which would normally be exposed globally to the template, but when merging, is contained in each separate instance in the list.

Your code would be more readable if you used "instance" instead:

{% for instance in instances %}
Reference: {{ instance.order.reference }}<br>
{% endfor %}

I'll make some updates to the docs to make this more clearer

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@tristanle22
Comment options

Comment options

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

Answer selected by gunstr
@gunstr
Comment options

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