Exporters overview¶
django-invoicing ships with a pluggable export system built on top of django-outputs. Every export format is represented by two cooperating classes:
- Exporter — knows how to render a queryset of invoices into a file or API payload.
- Manager — owns the Django Admin action(s) and wires the exporter into the request lifecycle.
How exports work¶
- A user selects invoices in Django Admin and picks an export action.
InvoiceAdmin.get_actions()finds allexport_*methods on every configured manager and registers them as actions.- The action calls the manager method (e.g.
PdfManager.export_detail_pdf()). - The manager validates the queryset: it must be non-empty, and when a manager sets
required_originall exported invoices must share that origin. Managers withoutrequired_originmay export mixed-origin querysets. - For file-based exports the manager calls
outputs.usecases.execute_export(), which queues an async task and emails the result to the requesting user. - For API-based exports (MRP v2, IKROS, Profit365) the manager posts directly to the external service.
Configuring managers¶
Managers are configured in settings.py via INVOICING_MANAGERS. The default configuration enables PDF and XLSX:
INVOICING_MANAGERS = {
"invoicing.exporters.pdf.managers.PdfManager": {},
"invoicing.exporters.xlsx.managers.XlsxManager": {},
}
Replace or extend this dict to change the active set of exporters. Each value is a manager-specific config dict.
Available managers¶
| Manager | Format | Config required |
|---|---|---|
PdfManager |
None | |
XlsxManager |
Excel (XLSX) | None |
IsdocManager |
ISDOC XML | None |
MrpV1Manager |
MRP XML v1 | None |
MrpIssuedManager |
MRP XML / API v2 (issued) | API_URL |
MrpReceivedManager |
MRP XML / API v2 (received) | API_URL |
IKrosManager |
IKROS API | API_URL, API_KEY |
Profit365Manager |
Profit365 API | API_URL, API_DATA |
See the individual pages for full configuration details and admin action names.