report editor broken in production install
Please verify that this bug has NOT been raised before.
- [x] I checked and didn't find a similar issue
Describe the bug*
When trying to preview a template in the admin center > labe/report templates, I get the following instead of the rendered PDF:
(I have tested with latest chrome and safari)
Not sure why this stopped working, but I am sure this was working a few weeks ago.
Steps to Reproduce
- Goto https://demo.inventree.org/web/settings/admin/labels/1/
- Click on save & preview
- See wrongly shown result
Expected behaviour
The rendered PDF should show
Deployment Method
- [x] Docker
- [ ] Package
- [ ] Bare metal
- [ ] Other - added info in Steps to Reproduce
Version Information
InvenTree-Version: 0.18.0 dev Django Version: 4.2.20 Commit Hash: c41760a Commit Date: 2025-04-25 Commit Branch: null Database: postgresql Debug-Mode: False Deployed using Docker: True Platform: Linux-5.15.0-100-generic-x86_64-with Installer: DOC Active plugins: false
Please verify if you can reproduce this bug on the demo site.
- [x] I can reproduce this bug on the demo site.
Relevant log output
Does normal report printing work properly?
Yes, normal printing from a user's view works as expected, just the preview in the admin center is broken now.
What is the content of the API response?
Ok, the issue seems, that now somehow there is no output provided when running with a worker in the print response. Therefore the [object object] we were seeing is just the print response itself, as the code thinks thats a pdf.
https://github.com/inventree/InvenTree/blob/9729c41783a24a0fae14001a6396e383ce5c6add/src/frontend/src/components/editors/TemplateEditor/PdfPreview/PdfPreview.tsx#L53-L61
Oh right because we background the print job now - https://github.com/inventree/InvenTree/pull/9199
So the template editors will need to monitor the printing status and display the output when it completes... Didn't think of that.
There is a hook available which provides this full functionality. Perhaps you might have time to implement this fix?
I have created a PR to fix this, see #9591