Report merge problem #10949
-
|
I would need a report where I from the Sales table select SOs and print some order data as a single table in a report. The template looks like this: Without using the "merge" function I get the four data points for each selected SO but on separate pages. With "Merge" enabled I get all selected SOs in one table but only the "Reference" and "Description" cells are populated while "Shipment Date" and Total Price" is blank. I have tried to find any hints by reading the documentation and the PR for the Merge function and what I understand there should not be any such limitations. Any suggestions what might be wrong is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
@tristanle22 , sorry to bother you but as you submitted the PR for the report "merge" function I'm reaching out to get your view on the issue I describe above. In short all four data points are populated when I print one report per sales order. But when I use the "merge" function only two are populated in the table. I would need to understand if I have misunderstood how to use the merge function, if it is an expected limitation or if it is a bug. |
Beta Was this translation helpful? Give feedback.
-
|
@tristanle22 that worked perfectly, thanks a lot! |
Beta Was this translation helpful? Give feedback.
@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:
I'll make some updates to the docs to make this more clearer