Metadata-Version: 2.1
Name: odoo-addon-file_download
Version: 17.0.1.0.0.1
Requires-Python: >=3.10
Requires-Dist: odoo>=17.0a,<17.1dev
Requires-Dist: odoo_test_helper
Summary: Download file
Home-page: https://github.com/sygel-technology/sy-server-backend
License: AGPL-3
Author: Sygel
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 17.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

=============
File download
=============

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:98cb8f5bae30ed9a4df50b5cb799a4f60ea28313104f5f73cb27d0d0a0c3b570
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-sygel--technology%2Fsy--server--backend-lightgray.png?logo=github
    :target: https://github.com/sygel-technology/sy-server-backend/tree/17.0/file_download
    :alt: sygel-technology/sy-server-backend

|badge1| |badge2| |badge3|

This module lets you call a wizard to download any file.

**Table of contents**

.. contents::
   :local:

Usage
=====

To use this module, you need to:

1. Create a model that inherits from file.download.model.
2. Override the following functions:

   - **\`get_filename\`**: Return the desired file name.

   - **\`get_content\`**: Return the binary string file to download. For
     example:

     .. code:: python

        from io import StringIO

        def get_content(self):
            output = StringIO()
            file.save(output)
            output.seek(0)
            return output.read()

3. After this, create a wizard with a button that calls the function
   set_file. This function will open a new wizard with the downloadable
   file.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-server-backend/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/sygel-technology/sy-server-backend/issues/new?body=module:%20file_download%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Sygel

Contributors
------------

- `Sygel <https://www.sygel.es>`__:

  - Valentín Vinagre
  - Ángel García de la Chica Herrera

Maintainers
-----------

This module is part of the `sygel-technology/sy-server-backend <https://github.com/sygel-technology/sy-server-backend/tree/17.0/file_download>`_ project on GitHub.

You are welcome to contribute.
