From bd83b93d08c6e97b5bdcb9bee59224df37d2986b Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 21 Aug 2023 14:34:27 +0000 Subject: [PATCH] [UPD] README.rst --- attachment_zipped_download/README.rst | 81 +++++++++++++++++++ .../static/description/index.html | 77 ++++++++++++++++++ 2 files changed, 158 insertions(+) diff --git a/attachment_zipped_download/README.rst b/attachment_zipped_download/README.rst index 58bb48c4..2d1253c3 100644 --- a/attachment_zipped_download/README.rst +++ b/attachment_zipped_download/README.rst @@ -27,6 +27,9 @@ Attachment Zipped Download 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** .. contents:: @@ -38,6 +41,82 @@ Usage #. Go to *Settings > Technical > Database Structure > Attachments* and select some files. #. 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:: + + + + + + stock.picking.tree download attachments + stock.picking + + +