django-oscar-invoices
django-oscar-invoices copied to clipboard
Application for invoices generation in Django-Oscar.
===================== django-oscar-invoices
Quickstart
Installation
.. code-block:: console
$ pip install django-oscar-invoices
Setup
-
Add
oscar_invoicesto theINSTALLED_APPSvariable of your project'ssettings.py. -
Sync the database using
python manage.py migrate. -
Create instances of
LegalEntityandLegalEntityAddress. -
Integrate
InvoiceCreatorin your checkout process.
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
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.
You can find more information in documentation_.
.. _documentation: https://django-oscar-invoices.readthedocs.io
Sandbox
Sandbox environment set up to automatically create invoices on checkout.
But for this, instances of LegalEntity and LegalEntityAddress must be created
(from admin site) before order placement.