Files
InvenTree/src/backend
a5ea65aa45 fix(report): support S3 cloud media storage for report and label template loading (#12426) (#12943)
* fix(report): support S3 cloud media storage for report and label template loading (#12426)

- Prevent TemplateDoesNotExist when using cloud storage backends (e.g. S3 via django-storages)
- Update TemplateUploadMixin.template_name to return relative storage path when local file does not exist on disk
- Implement ReportTemplateBase.get_template_content() to load content from storage backend and resolve bucket/location prefix mismatches
- Add fallback in ReportTemplateBase.render_as_string() to render from storage content when template loader lookup fails
- Register InvenTreeStorageTemplateLoader to allow template snippets to resolve directly from default_storage
- Add unit tests in S3ReportTemplateTest covering prefix resolution, remote rendering, and storage template loading

* fix style

* remove weasyprint unavailable hacks

this is unrealstic in a full enviroment; the only reason for this is some very constraint sandbox - which is not our run enviroment

* fix import

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2026-10-14 10:02:04 +11:00
..