django-oscar-invoices
How invoices are generated?
In order to generate invoice it's required to create two model records:
-
Merchant account, :class:
~oscar_invoices.abstract_models.AbstractLegalEntity
. In contains shop name, seller's business name, website, email, VAT number etc. -
Merchant address, :class:
~oscar_invoices.abstract_models.AbstractLegalEntityAddress
. It's quite similar to the order shipping or billing address.
By default, we generate only HTML invoice document and allow user to decide how to
generate PDF documents. You can integrate python-pdfkit
, WeasyPrint
, xhtml2pdf
,
reportlab
or another library of your choice.
.. _python-pdfkit
: https://github.com/JazzCore/python-pdfkit
.. _WeasyPrint
: https://github.com/Kozea/WeasyPrint
.. _xhtml2pdf
: https://github.com/xhtml2pdf/xhtml2pdf
.. _reportlab
: https://www.reportlab.com/
Since documents contains sensitive data, we store them out of the media folder and
do not provide public access via URL. For this purpose, we use custom storage class
:class:oscar_invoices.storages.DocumentsStorage
, invoice documents placed into the
nested folder settings.OSCAR_INVOICES_UPLOAD_FOLDER
and available for the admin users via
dashboard order list.