Skip to main content

Attachment Zipped Download

Project description

Odoo Community Association

Attachment Zipped Download

Beta License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runboat

This module allows downloading multiple attachments as a zip file.

This also provide a helper class IrAttachmentActionDownloadMixin to be used by developer to add action method on models.

Table of contents

Usage

  1. Go to Settings > Technical > Database Structure > Attachments and select some files.

  2. Go to Actions > Download and a zip file containing the selected files will be downloaded.

## For developer

You can reuse the IrAttachmentActionDownloadMixin on your favorite models:

from odoo import models


class StockPicking(models.Model):
    _name = "stock.picking"
    _inherit = ["stock.picking", "ir.attachment.action_download"]

Then you can add an action button on list view line or on the action button (when multiple lines are selected) to download all files:

<odoo>
    <!--
        add a button on list view to download all attachement present
        on the given transfert
    -->
    <record id="vpicktree" model="ir.ui.view">
        <field name="inherit_id" ref="stock.vpicktree"/>
        <field name="name">stock.picking.tree download attachments</field>
        <field name="model">stock.picking</field>
        <field name="arch" type="xml">
            <field name="json_popover" position="after">
                <button name="action_download_attachments"
                    type="object"
                    icon="fa-download"
                    string="Download attachment(s)"
                    aria-label="Download Proof documents"
                    class="float-right"/>
            </field>
        </field>
    </record>

    <!--
        Add "Download attachments" item in the Action menu when
        multiple records are selected
    -->
    <record id="action_download_picking_attachements" model="ir.actions.server">
        <field name="name">Download attachments</field>
        <field name="model_id" ref="stock.model_stock_picking"/>
        <field name="binding_model_id" ref="stock.model_stock_picking"/>
        <field name="binding_view_types">list</field>
        <field name="state">code</field>
        <field name="code">
            action = records.action_download_attachments()
        </field>
    </record>
</odoo>

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

  • Tecnativa

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/knowledge project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/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.

File details

Details for the file odoo_addon_attachment_zipped_download-19.0.1.0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_attachment_zipped_download-19.0.1.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea862d9bd40a13a7839f190c579d1ed0af96d72d82e785966b1a8978d4caf5e5
MD5 f4f05acc13a10fd25082695bc2a457f7
BLAKE2b-256 aa5bc88b8729e741c9d2c1236b194e892d912529f2e270083d23d2c1e657d382

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