Skip to main content

Download file

Project description

Beta License: AGPL-3 sygel-technology/sy-server-backend

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

Table of contents

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:

      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. 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.

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

Credits

Authors

  • Sygel

Contributors

  • Sygel:

    • Valentín Vinagre

    • Ángel García de la Chica Herrera

Maintainers

This module is part of the sygel-technology/sy-server-backend project on GitHub.

You are welcome to contribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odoo_addon_file_download-17.0.1.0.0.1-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file odoo_addon_file_download-17.0.1.0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_file_download-17.0.1.0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 647ffa2000bf2a7cb44720af11505173ce4ee649f102c0c303700578bb282706
MD5 ab6e122d78f4febf4fb9c13dc2a71411
BLAKE2b-256 1ac6f24bd24a4c0d492eeadc4a69d86fa21beb2a5aa7aba2801e9bc8645725e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page