odoo-addon-product-attachment-zipped-download 15.0.1.0.0.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (20) hide show
  1. odoo/addons/product_attachment_zipped_download/README.rst +87 -0
  2. odoo/addons/product_attachment_zipped_download/__init__.py +1 -0
  3. odoo/addons/product_attachment_zipped_download/__manifest__.py +14 -0
  4. odoo/addons/product_attachment_zipped_download/i18n/es.po +36 -0
  5. odoo/addons/product_attachment_zipped_download/i18n/product_attachment_zipped_download.pot +30 -0
  6. odoo/addons/product_attachment_zipped_download/models/__init__.py +2 -0
  7. odoo/addons/product_attachment_zipped_download/models/product_product.py +23 -0
  8. odoo/addons/product_attachment_zipped_download/models/product_template.py +23 -0
  9. odoo/addons/product_attachment_zipped_download/readme/CONTRIBUTORS.rst +4 -0
  10. odoo/addons/product_attachment_zipped_download/readme/DESCRIPTION.rst +1 -0
  11. odoo/addons/product_attachment_zipped_download/static/description/icon.png +0 -0
  12. odoo/addons/product_attachment_zipped_download/static/description/index.html +427 -0
  13. odoo/addons/product_attachment_zipped_download/tests/__init__.py +3 -0
  14. odoo/addons/product_attachment_zipped_download/tests/test_product_attachment_zipped_download.py +99 -0
  15. odoo/addons/product_attachment_zipped_download/views/product_product_views.xml +13 -0
  16. odoo/addons/product_attachment_zipped_download/views/product_template_views.xml +16 -0
  17. odoo_addon_product_attachment_zipped_download-15.0.1.0.0.1.dist-info/METADATA +106 -0
  18. odoo_addon_product_attachment_zipped_download-15.0.1.0.0.1.dist-info/RECORD +20 -0
  19. odoo_addon_product_attachment_zipped_download-15.0.1.0.0.1.dist-info/WHEEL +5 -0
  20. odoo_addon_product_attachment_zipped_download-15.0.1.0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,87 @@
1
+ ==================================
2
+ Product Attachment Zipped Download
3
+ ==================================
4
+
5
+ ..
6
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
+ !! This file is generated by oca-gen-addon-readme !!
8
+ !! changes will be overwritten. !!
9
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
+ !! source digest: sha256:83ad066d1fff91f3a30547d9094b4d4bacd0e7614498a95854047bb2e9e52f0b
11
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
+
13
+ .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14
+ :target: https://odoo-community.org/page/development-status
15
+ :alt: Beta
16
+ .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
+ :alt: License: AGPL-3
19
+ .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
20
+ :target: https://github.com/OCA/product-attribute/tree/15.0/product_attachment_zipped_download
21
+ :alt: OCA/product-attribute
22
+ .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
+ :target: https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_attachment_zipped_download
24
+ :alt: Translate me on Weblate
25
+ .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=15.0
27
+ :alt: Try me on Runboat
28
+
29
+ |badge1| |badge2| |badge3| |badge4| |badge5|
30
+
31
+ This module allows the possibility to download attachments in a .zip file of the selected products.
32
+
33
+ **Table of contents**
34
+
35
+ .. contents::
36
+ :local:
37
+
38
+ Bug Tracker
39
+ ===========
40
+
41
+ Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
42
+ In case of trouble, please check there if your issue has already been reported.
43
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
44
+ `feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_attachment_zipped_download%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
45
+
46
+ Do not contact contributors directly about support or help with technical issues.
47
+
48
+ Credits
49
+ =======
50
+
51
+ Authors
52
+ ~~~~~~~
53
+
54
+ * Tecnativa
55
+
56
+ Contributors
57
+ ~~~~~~~~~~~~
58
+
59
+ * `Tecnativa <https://www.tecnativa.com>`_:
60
+
61
+ * Víctor Martínez
62
+ * Pedro M. Baeza
63
+
64
+ Maintainers
65
+ ~~~~~~~~~~~
66
+
67
+ This module is maintained by the OCA.
68
+
69
+ .. image:: https://odoo-community.org/logo.png
70
+ :alt: Odoo Community Association
71
+ :target: https://odoo-community.org
72
+
73
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
74
+ mission is to support the collaborative development of Odoo features and
75
+ promote its widespread use.
76
+
77
+ .. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px
78
+ :target: https://github.com/victoralmau
79
+ :alt: victoralmau
80
+
81
+ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
82
+
83
+ |maintainer-victoralmau|
84
+
85
+ This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/15.0/product_attachment_zipped_download>`_ project on GitHub.
86
+
87
+ You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -0,0 +1 @@
1
+ from . import models
@@ -0,0 +1,14 @@
1
+ # Copyright 2024 Tecnativa - Víctor Martínez
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
+ {
4
+ "name": "Product Attachment Zipped Download",
5
+ "version": "15.0.1.0.0",
6
+ "category": "Product Management",
7
+ "website": "https://github.com/OCA/product-attribute",
8
+ "author": "Tecnativa, Odoo Community Association (OCA)",
9
+ "license": "AGPL-3",
10
+ "depends": ["attachment_zipped_download", "product"],
11
+ "data": ["views/product_product_views.xml", "views/product_template_views.xml"],
12
+ "installable": True,
13
+ "maintainers": ["victoralmau"],
14
+ }
@@ -0,0 +1,36 @@
1
+ # Translation of Odoo Server.
2
+ # This file contains the translation of the following modules:
3
+ # * product_attachment_zipped_download
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: Odoo Server 15.0\n"
8
+ "Report-Msgid-Bugs-To: \n"
9
+ "POT-Creation-Date: 2024-04-15 07:00+0000\n"
10
+ "PO-Revision-Date: 2024-04-15 09:01+0200\n"
11
+ "Last-Translator: \n"
12
+ "Language-Team: \n"
13
+ "Language: es\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: \n"
18
+ "X-Generator: Poedit 3.0.1\n"
19
+
20
+ #. module: product_attachment_zipped_download
21
+ #: model:ir.actions.server,name:product_attachment_zipped_download.action_download_product_product_attachements
22
+ #: model:ir.actions.server,name:product_attachment_zipped_download.action_download_product_template_attachements
23
+ msgid "Download attachments"
24
+ msgstr "Descargar adjuntos"
25
+
26
+ #. module: product_attachment_zipped_download
27
+ #: model:ir.model,name:product_attachment_zipped_download.model_product_product
28
+ #, fuzzy
29
+ #| msgid "Product Template"
30
+ msgid "Product"
31
+ msgstr "Producto"
32
+
33
+ #. module: product_attachment_zipped_download
34
+ #: model:ir.model,name:product_attachment_zipped_download.model_product_template
35
+ msgid "Product Template"
36
+ msgstr "Plantilla de producto"
@@ -0,0 +1,30 @@
1
+ # Translation of Odoo Server.
2
+ # This file contains the translation of the following modules:
3
+ # * product_attachment_zipped_download
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: Odoo Server 15.0\n"
8
+ "Report-Msgid-Bugs-To: \n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: \n"
14
+ "Plural-Forms: \n"
15
+
16
+ #. module: product_attachment_zipped_download
17
+ #: model:ir.actions.server,name:product_attachment_zipped_download.action_download_product_product_attachements
18
+ #: model:ir.actions.server,name:product_attachment_zipped_download.action_download_product_template_attachements
19
+ msgid "Download attachments"
20
+ msgstr ""
21
+
22
+ #. module: product_attachment_zipped_download
23
+ #: model:ir.model,name:product_attachment_zipped_download.model_product_product
24
+ msgid "Product"
25
+ msgstr ""
26
+
27
+ #. module: product_attachment_zipped_download
28
+ #: model:ir.model,name:product_attachment_zipped_download.model_product_template
29
+ msgid "Product Template"
30
+ msgstr ""
@@ -0,0 +1,2 @@
1
+ from . import product_product
2
+ from . import product_template
@@ -0,0 +1,23 @@
1
+ # Copyright 2024 Tecnativa - Víctor Martínez
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3
+
4
+ from odoo import models
5
+
6
+
7
+ class Productproduct(models.Model):
8
+ _name = "product.product"
9
+ _inherit = ["product.product", "ir.attachment.action_download"]
10
+
11
+ def _get_downloadable_attachments(self):
12
+ """Overwrite to get the attachments from template or variants."""
13
+ return self.env["ir.attachment"].search(
14
+ [
15
+ "|",
16
+ "&",
17
+ ("res_model", "=", "product.product"),
18
+ ("res_id", "in", self.ids),
19
+ "&",
20
+ ("res_model", "=", "product.template"),
21
+ ("res_id", "in", self.product_tmpl_id.ids),
22
+ ]
23
+ )
@@ -0,0 +1,23 @@
1
+ # Copyright 2024 Tecnativa - Víctor Martínez
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3
+
4
+ from odoo import models
5
+
6
+
7
+ class ProductTemplate(models.Model):
8
+ _name = "product.template"
9
+ _inherit = ["product.template", "ir.attachment.action_download"]
10
+
11
+ def _get_downloadable_attachments(self):
12
+ """Overwrite to get the attachments from template or variants."""
13
+ return self.env["ir.attachment"].search(
14
+ [
15
+ "|",
16
+ "&",
17
+ ("res_model", "=", "product.product"),
18
+ ("res_id", "in", self.product_variant_ids.ids),
19
+ "&",
20
+ ("res_model", "=", "product.template"),
21
+ ("res_id", "in", self.ids),
22
+ ]
23
+ )
@@ -0,0 +1,4 @@
1
+ * `Tecnativa <https://www.tecnativa.com>`_:
2
+
3
+ * Víctor Martínez
4
+ * Pedro M. Baeza
@@ -0,0 +1 @@
1
+ This module allows the possibility to download attachments in a .zip file of the selected products.
@@ -0,0 +1,427 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
7
+ <title>Product Attachment Zipped Download</title>
8
+ <style type="text/css">
9
+
10
+ /*
11
+ :Author: David Goodger (goodger@python.org)
12
+ :Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
13
+ :Copyright: This stylesheet has been placed in the public domain.
14
+
15
+ Default cascading style sheet for the HTML output of Docutils.
16
+
17
+ See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
18
+ customize this style sheet.
19
+ */
20
+
21
+ /* used to remove borders from tables and images */
22
+ .borderless, table.borderless td, table.borderless th {
23
+ border: 0 }
24
+
25
+ table.borderless td, table.borderless th {
26
+ /* Override padding for "table.docutils td" with "! important".
27
+ The right padding separates the table cells. */
28
+ padding: 0 0.5em 0 0 ! important }
29
+
30
+ .first {
31
+ /* Override more specific margin styles with "! important". */
32
+ margin-top: 0 ! important }
33
+
34
+ .last, .with-subtitle {
35
+ margin-bottom: 0 ! important }
36
+
37
+ .hidden {
38
+ display: none }
39
+
40
+ .subscript {
41
+ vertical-align: sub;
42
+ font-size: smaller }
43
+
44
+ .superscript {
45
+ vertical-align: super;
46
+ font-size: smaller }
47
+
48
+ a.toc-backref {
49
+ text-decoration: none ;
50
+ color: black }
51
+
52
+ blockquote.epigraph {
53
+ margin: 2em 5em ; }
54
+
55
+ dl.docutils dd {
56
+ margin-bottom: 0.5em }
57
+
58
+ object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
+ overflow: hidden;
60
+ }
61
+
62
+ /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
+ dl.docutils dt {
64
+ font-weight: bold }
65
+ */
66
+
67
+ div.abstract {
68
+ margin: 2em 5em }
69
+
70
+ div.abstract p.topic-title {
71
+ font-weight: bold ;
72
+ text-align: center }
73
+
74
+ div.admonition, div.attention, div.caution, div.danger, div.error,
75
+ div.hint, div.important, div.note, div.tip, div.warning {
76
+ margin: 2em ;
77
+ border: medium outset ;
78
+ padding: 1em }
79
+
80
+ div.admonition p.admonition-title, div.hint p.admonition-title,
81
+ div.important p.admonition-title, div.note p.admonition-title,
82
+ div.tip p.admonition-title {
83
+ font-weight: bold ;
84
+ font-family: sans-serif }
85
+
86
+ div.attention p.admonition-title, div.caution p.admonition-title,
87
+ div.danger p.admonition-title, div.error p.admonition-title,
88
+ div.warning p.admonition-title, .code .error {
89
+ color: red ;
90
+ font-weight: bold ;
91
+ font-family: sans-serif }
92
+
93
+ /* Uncomment (and remove this text!) to get reduced vertical space in
94
+ compound paragraphs.
95
+ div.compound .compound-first, div.compound .compound-middle {
96
+ margin-bottom: 0.5em }
97
+
98
+ div.compound .compound-last, div.compound .compound-middle {
99
+ margin-top: 0.5em }
100
+ */
101
+
102
+ div.dedication {
103
+ margin: 2em 5em ;
104
+ text-align: center ;
105
+ font-style: italic }
106
+
107
+ div.dedication p.topic-title {
108
+ font-weight: bold ;
109
+ font-style: normal }
110
+
111
+ div.figure {
112
+ margin-left: 2em ;
113
+ margin-right: 2em }
114
+
115
+ div.footer, div.header {
116
+ clear: both;
117
+ font-size: smaller }
118
+
119
+ div.line-block {
120
+ display: block ;
121
+ margin-top: 1em ;
122
+ margin-bottom: 1em }
123
+
124
+ div.line-block div.line-block {
125
+ margin-top: 0 ;
126
+ margin-bottom: 0 ;
127
+ margin-left: 1.5em }
128
+
129
+ div.sidebar {
130
+ margin: 0 0 0.5em 1em ;
131
+ border: medium outset ;
132
+ padding: 1em ;
133
+ background-color: #ffffee ;
134
+ width: 40% ;
135
+ float: right ;
136
+ clear: right }
137
+
138
+ div.sidebar p.rubric {
139
+ font-family: sans-serif ;
140
+ font-size: medium }
141
+
142
+ div.system-messages {
143
+ margin: 5em }
144
+
145
+ div.system-messages h1 {
146
+ color: red }
147
+
148
+ div.system-message {
149
+ border: medium outset ;
150
+ padding: 1em }
151
+
152
+ div.system-message p.system-message-title {
153
+ color: red ;
154
+ font-weight: bold }
155
+
156
+ div.topic {
157
+ margin: 2em }
158
+
159
+ h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
+ h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
+ margin-top: 0.4em }
162
+
163
+ h1.title {
164
+ text-align: center }
165
+
166
+ h2.subtitle {
167
+ text-align: center }
168
+
169
+ hr.docutils {
170
+ width: 75% }
171
+
172
+ img.align-left, .figure.align-left, object.align-left, table.align-left {
173
+ clear: left ;
174
+ float: left ;
175
+ margin-right: 1em }
176
+
177
+ img.align-right, .figure.align-right, object.align-right, table.align-right {
178
+ clear: right ;
179
+ float: right ;
180
+ margin-left: 1em }
181
+
182
+ img.align-center, .figure.align-center, object.align-center {
183
+ display: block;
184
+ margin-left: auto;
185
+ margin-right: auto;
186
+ }
187
+
188
+ table.align-center {
189
+ margin-left: auto;
190
+ margin-right: auto;
191
+ }
192
+
193
+ .align-left {
194
+ text-align: left }
195
+
196
+ .align-center {
197
+ clear: both ;
198
+ text-align: center }
199
+
200
+ .align-right {
201
+ text-align: right }
202
+
203
+ /* reset inner alignment in figures */
204
+ div.align-right {
205
+ text-align: inherit }
206
+
207
+ /* div.align-center * { */
208
+ /* text-align: left } */
209
+
210
+ .align-top {
211
+ vertical-align: top }
212
+
213
+ .align-middle {
214
+ vertical-align: middle }
215
+
216
+ .align-bottom {
217
+ vertical-align: bottom }
218
+
219
+ ol.simple, ul.simple {
220
+ margin-bottom: 1em }
221
+
222
+ ol.arabic {
223
+ list-style: decimal }
224
+
225
+ ol.loweralpha {
226
+ list-style: lower-alpha }
227
+
228
+ ol.upperalpha {
229
+ list-style: upper-alpha }
230
+
231
+ ol.lowerroman {
232
+ list-style: lower-roman }
233
+
234
+ ol.upperroman {
235
+ list-style: upper-roman }
236
+
237
+ p.attribution {
238
+ text-align: right ;
239
+ margin-left: 50% }
240
+
241
+ p.caption {
242
+ font-style: italic }
243
+
244
+ p.credits {
245
+ font-style: italic ;
246
+ font-size: smaller }
247
+
248
+ p.label {
249
+ white-space: nowrap }
250
+
251
+ p.rubric {
252
+ font-weight: bold ;
253
+ font-size: larger ;
254
+ color: maroon ;
255
+ text-align: center }
256
+
257
+ p.sidebar-title {
258
+ font-family: sans-serif ;
259
+ font-weight: bold ;
260
+ font-size: larger }
261
+
262
+ p.sidebar-subtitle {
263
+ font-family: sans-serif ;
264
+ font-weight: bold }
265
+
266
+ p.topic-title {
267
+ font-weight: bold }
268
+
269
+ pre.address {
270
+ margin-bottom: 0 ;
271
+ margin-top: 0 ;
272
+ font: inherit }
273
+
274
+ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
+ margin-left: 2em ;
276
+ margin-right: 2em }
277
+
278
+ pre.code .ln { color: grey; } /* line numbers */
279
+ pre.code, code { background-color: #eeeeee }
280
+ pre.code .comment, code .comment { color: #5C6576 }
281
+ pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
+ pre.code .literal.string, code .literal.string { color: #0C5404 }
283
+ pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
+ pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
+ pre.code .inserted, code .inserted { background-color: #A3D289}
286
+
287
+ span.classifier {
288
+ font-family: sans-serif ;
289
+ font-style: oblique }
290
+
291
+ span.classifier-delimiter {
292
+ font-family: sans-serif ;
293
+ font-weight: bold }
294
+
295
+ span.interpreted {
296
+ font-family: sans-serif }
297
+
298
+ span.option {
299
+ white-space: nowrap }
300
+
301
+ span.pre {
302
+ white-space: pre }
303
+
304
+ span.problematic {
305
+ color: red }
306
+
307
+ span.section-subtitle {
308
+ /* font-size relative to parent (h1..h6 element) */
309
+ font-size: 80% }
310
+
311
+ table.citation {
312
+ border-left: solid 1px gray;
313
+ margin-left: 1px }
314
+
315
+ table.docinfo {
316
+ margin: 2em 4em }
317
+
318
+ table.docutils {
319
+ margin-top: 0.5em ;
320
+ margin-bottom: 0.5em }
321
+
322
+ table.footnote {
323
+ border-left: solid 1px black;
324
+ margin-left: 1px }
325
+
326
+ table.docutils td, table.docutils th,
327
+ table.docinfo td, table.docinfo th {
328
+ padding-left: 0.5em ;
329
+ padding-right: 0.5em ;
330
+ vertical-align: top }
331
+
332
+ table.docutils th.field-name, table.docinfo th.docinfo-name {
333
+ font-weight: bold ;
334
+ text-align: left ;
335
+ white-space: nowrap ;
336
+ padding-left: 0 }
337
+
338
+ /* "booktabs" style (no vertical lines) */
339
+ table.docutils.booktabs {
340
+ border: 0px;
341
+ border-top: 2px solid;
342
+ border-bottom: 2px solid;
343
+ border-collapse: collapse;
344
+ }
345
+ table.docutils.booktabs * {
346
+ border: 0px;
347
+ }
348
+ table.docutils.booktabs th {
349
+ border-bottom: thin solid;
350
+ text-align: left;
351
+ }
352
+
353
+ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
+ h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
+ font-size: 100% }
356
+
357
+ ul.auto-toc {
358
+ list-style-type: none }
359
+
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <div class="document" id="product-attachment-zipped-download">
364
+ <h1 class="title">Product Attachment Zipped Download</h1>
365
+
366
+ <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
+ !! This file is generated by oca-gen-addon-readme !!
368
+ !! changes will be overwritten. !!
369
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
+ !! source digest: sha256:83ad066d1fff91f3a30547d9094b4d4bacd0e7614498a95854047bb2e9e52f0b
371
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/15.0/product_attachment_zipped_download"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_attachment_zipped_download"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
+ <p>This module allows the possibility to download attachments in a .zip file of the selected products.</p>
374
+ <p><strong>Table of contents</strong></p>
375
+ <div class="contents local topic" id="contents">
376
+ <ul class="simple">
377
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
378
+ <li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
379
+ <li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
380
+ <li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
381
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
382
+ </ul>
383
+ </li>
384
+ </ul>
385
+ </div>
386
+ <div class="section" id="bug-tracker">
387
+ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
388
+ <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-attribute/issues">GitHub Issues</a>.
389
+ In case of trouble, please check there if your issue has already been reported.
390
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
391
+ <a class="reference external" href="https://github.com/OCA/product-attribute/issues/new?body=module:%20product_attachment_zipped_download%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
392
+ <p>Do not contact contributors directly about support or help with technical issues.</p>
393
+ </div>
394
+ <div class="section" id="credits">
395
+ <h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
396
+ <div class="section" id="authors">
397
+ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
398
+ <ul class="simple">
399
+ <li>Tecnativa</li>
400
+ </ul>
401
+ </div>
402
+ <div class="section" id="contributors">
403
+ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
404
+ <ul class="simple">
405
+ <li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
406
+ <li>Víctor Martínez</li>
407
+ <li>Pedro M. Baeza</li>
408
+ </ul>
409
+ </li>
410
+ </ul>
411
+ </div>
412
+ <div class="section" id="maintainers">
413
+ <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
414
+ <p>This module is maintained by the OCA.</p>
415
+ <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
416
+ <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
417
+ mission is to support the collaborative development of Odoo features and
418
+ promote its widespread use.</p>
419
+ <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
420
+ <p><a class="reference external image-reference" href="https://github.com/victoralmau"><img alt="victoralmau" src="https://github.com/victoralmau.png?size=40px" /></a></p>
421
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/15.0/product_attachment_zipped_download">OCA/product-attribute</a> project on GitHub.</p>
422
+ <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
423
+ </div>
424
+ </div>
425
+ </div>
426
+ </body>
427
+ </html>
@@ -0,0 +1,3 @@
1
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
2
+
3
+ from . import test_product_attachment_zipped_download
@@ -0,0 +1,99 @@
1
+ # Copyright 2024 Tecnativa - Víctor Martínez
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
+ from odoo.tests import TransactionCase
4
+
5
+ from odoo.addons.attachment_zipped_download.tests.test_attachment_zipped_download import (
6
+ TestAttachmentZippedDownloadBase,
7
+ )
8
+
9
+
10
+ class TestProductAttachmentZippedDownload(
11
+ TransactionCase, TestAttachmentZippedDownloadBase
12
+ ):
13
+ @classmethod
14
+ def setUpClass(cls):
15
+ super().setUpClass()
16
+ cls.product_a = cls.env["product.product"].create({"name": "Test product A"})
17
+ cls.product_b = cls.env["product.product"].create({"name": "Test product B"})
18
+ cls.product_c = cls.env["product.product"].create({"name": "Test product C"})
19
+ cls.attachment_a = cls._create_attachment(
20
+ cls.env,
21
+ cls.env.uid,
22
+ "product-a.txt",
23
+ model=cls.product_a._name,
24
+ res_id=cls.product_a.id,
25
+ )
26
+ cls.attachment_b = cls._create_attachment(
27
+ cls.env,
28
+ cls.env.uid,
29
+ "product-b.txt",
30
+ model=cls.product_b._name,
31
+ res_id=cls.product_b.id,
32
+ )
33
+ cls.attachment_b_extra = cls._create_attachment(
34
+ cls.env,
35
+ cls.env.uid,
36
+ "product-template-b.txt",
37
+ model=cls.product_b.product_tmpl_id._name,
38
+ res_id=cls.product_b.product_tmpl_id.id,
39
+ )
40
+
41
+ def test_action_download_attachments_no_attachment(self):
42
+ action = self.product_c.product_tmpl_id.action_download_attachments()
43
+ self.assertEqual(action["type"], "ir.actions.client")
44
+ self.assertEqual(action["tag"], "display_notification")
45
+ action = self.product_c.action_download_attachments()
46
+ self.assertEqual(action["type"], "ir.actions.client")
47
+ self.assertEqual(action["tag"], "display_notification")
48
+
49
+ def test_action_download_attachments_one_attachment_1(self):
50
+ action = self.product_a.product_tmpl_id.action_download_attachments()
51
+ self.assertEqual(action["type"], "ir.actions.act_url")
52
+ self.assertEqual(action["target"], "self")
53
+ self.assertEqual(
54
+ action["url"], "/web/content/%s?download=1" % self.attachment_a.id
55
+ )
56
+ action = self.product_a.action_download_attachments()
57
+ self.assertEqual(action["type"], "ir.actions.act_url")
58
+ self.assertEqual(action["target"], "self")
59
+ self.assertEqual(
60
+ action["url"], "/web/content/%s?download=1" % self.attachment_a.id
61
+ )
62
+
63
+ def test_action_download_attachments_one_attachment_2(self):
64
+ action = self.product_b.product_tmpl_id.action_download_attachments()
65
+ self.assertEqual(action["type"], "ir.actions.act_url")
66
+ self.assertEqual(action["target"], "self")
67
+ self.assertTrue(action["url"].startswith("/web/attachment/download_zip?ids="))
68
+ attachment_ids = sorted(map(int, action["url"].split("=")[1].split(",")))
69
+ self.assertNotIn(self.attachment_a.id, attachment_ids)
70
+ self.assertIn(self.attachment_b.id, attachment_ids)
71
+ self.assertIn(self.attachment_b_extra.id, attachment_ids)
72
+ action = self.product_b.action_download_attachments()
73
+ self.assertEqual(action["type"], "ir.actions.act_url")
74
+ self.assertEqual(action["target"], "self")
75
+ self.assertTrue(action["url"].startswith("/web/attachment/download_zip?ids="))
76
+ attachment_ids = sorted(map(int, action["url"].split("=")[1].split(",")))
77
+ self.assertNotIn(self.attachment_a.id, attachment_ids)
78
+ self.assertIn(self.attachment_b.id, attachment_ids)
79
+ self.assertIn(self.attachment_b_extra.id, attachment_ids)
80
+
81
+ def test_action_download_attachments_multi_attachment(self):
82
+ products = self.product_a + self.product_b + self.product_c
83
+ product_templates = products.mapped("product_tmpl_id")
84
+ action = product_templates.action_download_attachments()
85
+ self.assertEqual(action["type"], "ir.actions.act_url")
86
+ self.assertEqual(action["target"], "self")
87
+ self.assertTrue(action["url"].startswith("/web/attachment/download_zip?ids="))
88
+ attachment_ids = sorted(map(int, action["url"].split("=")[1].split(",")))
89
+ self.assertIn(self.attachment_a.id, attachment_ids)
90
+ self.assertIn(self.attachment_b.id, attachment_ids)
91
+ self.assertIn(self.attachment_b_extra.id, attachment_ids)
92
+ action = products.action_download_attachments()
93
+ self.assertEqual(action["type"], "ir.actions.act_url")
94
+ self.assertEqual(action["target"], "self")
95
+ self.assertTrue(action["url"].startswith("/web/attachment/download_zip?ids="))
96
+ attachment_ids = sorted(map(int, action["url"].split("=")[1].split(",")))
97
+ self.assertIn(self.attachment_a.id, attachment_ids)
98
+ self.assertIn(self.attachment_b.id, attachment_ids)
99
+ self.assertIn(self.attachment_b_extra.id, attachment_ids)
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+ <record id="action_download_product_product_attachements" model="ir.actions.server">
4
+ <field name="name">Download attachments</field>
5
+ <field name="model_id" ref="product.model_product_product" />
6
+ <field name="binding_model_id" ref="product.model_product_product" />
7
+ <field name="binding_view_types">list</field>
8
+ <field name="state">code</field>
9
+ <field name="code">
10
+ action = records.action_download_attachments()
11
+ </field>
12
+ </record>
13
+ </odoo>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+ <record
4
+ id="action_download_product_template_attachements"
5
+ model="ir.actions.server"
6
+ >
7
+ <field name="name">Download attachments</field>
8
+ <field name="model_id" ref="product.model_product_template" />
9
+ <field name="binding_model_id" ref="product.model_product_template" />
10
+ <field name="binding_view_types">list</field>
11
+ <field name="state">code</field>
12
+ <field name="code">
13
+ action = records.action_download_attachments()
14
+ </field>
15
+ </record>
16
+ </odoo>
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.1
2
+ Name: odoo-addon-product-attachment-zipped-download
3
+ Version: 15.0.1.0.0.1
4
+ Summary: Product Attachment Zipped Download
5
+ Home-page: https://github.com/OCA/product-attribute
6
+ Author: Tecnativa, Odoo Community Association (OCA)
7
+ Author-email: support@odoo-community.org
8
+ License: AGPL-3
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Framework :: Odoo
12
+ Classifier: Framework :: Odoo :: 15.0
13
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
14
+ Requires-Python: >=3.8
15
+ Requires-Dist: odoo-addon-attachment-zipped-download <15.1dev,>=15.0dev
16
+ Requires-Dist: odoo <15.1dev,>=15.0a
17
+
18
+ ==================================
19
+ Product Attachment Zipped Download
20
+ ==================================
21
+
22
+ ..
23
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24
+ !! This file is generated by oca-gen-addon-readme !!
25
+ !! changes will be overwritten. !!
26
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27
+ !! source digest: sha256:83ad066d1fff91f3a30547d9094b4d4bacd0e7614498a95854047bb2e9e52f0b
28
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29
+
30
+ .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
31
+ :target: https://odoo-community.org/page/development-status
32
+ :alt: Beta
33
+ .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
34
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
35
+ :alt: License: AGPL-3
36
+ .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
37
+ :target: https://github.com/OCA/product-attribute/tree/15.0/product_attachment_zipped_download
38
+ :alt: OCA/product-attribute
39
+ .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
40
+ :target: https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_attachment_zipped_download
41
+ :alt: Translate me on Weblate
42
+ .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
43
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=15.0
44
+ :alt: Try me on Runboat
45
+
46
+ |badge1| |badge2| |badge3| |badge4| |badge5|
47
+
48
+ This module allows the possibility to download attachments in a .zip file of the selected products.
49
+
50
+ **Table of contents**
51
+
52
+ .. contents::
53
+ :local:
54
+
55
+ Bug Tracker
56
+ ===========
57
+
58
+ Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
59
+ In case of trouble, please check there if your issue has already been reported.
60
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
61
+ `feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_attachment_zipped_download%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
62
+
63
+ Do not contact contributors directly about support or help with technical issues.
64
+
65
+ Credits
66
+ =======
67
+
68
+ Authors
69
+ ~~~~~~~
70
+
71
+ * Tecnativa
72
+
73
+ Contributors
74
+ ~~~~~~~~~~~~
75
+
76
+ * `Tecnativa <https://www.tecnativa.com>`_:
77
+
78
+ * Víctor Martínez
79
+ * Pedro M. Baeza
80
+
81
+ Maintainers
82
+ ~~~~~~~~~~~
83
+
84
+ This module is maintained by the OCA.
85
+
86
+ .. image:: https://odoo-community.org/logo.png
87
+ :alt: Odoo Community Association
88
+ :target: https://odoo-community.org
89
+
90
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
91
+ mission is to support the collaborative development of Odoo features and
92
+ promote its widespread use.
93
+
94
+ .. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px
95
+ :target: https://github.com/victoralmau
96
+ :alt: victoralmau
97
+
98
+ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
99
+
100
+ |maintainer-victoralmau|
101
+
102
+ This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/15.0/product_attachment_zipped_download>`_ project on GitHub.
103
+
104
+ You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
105
+
106
+
@@ -0,0 +1,20 @@
1
+ odoo/addons/product_attachment_zipped_download/README.rst,sha256=O-XvDQaLcMRX_-S7zoitC1vM6WCHWmIyVi1pZFw5Bz8,3331
2
+ odoo/addons/product_attachment_zipped_download/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
3
+ odoo/addons/product_attachment_zipped_download/__manifest__.py,sha256=6z36Pa2GtphcjL4Bz1-ZyJe749VnMhRYHDRlHwQN7aI,582
4
+ odoo/addons/product_attachment_zipped_download/i18n/es.po,sha256=WULXFZl-OIhzvpglhYNzz1BWKRV-nQKYMMDtiX2JhEQ,1232
5
+ odoo/addons/product_attachment_zipped_download/i18n/product_attachment_zipped_download.pot,sha256=bmaOOSybzTzolRS9E5utmOj03DiPo3wHtsEQxZtlTDo,1008
6
+ odoo/addons/product_attachment_zipped_download/models/__init__.py,sha256=YxtkqnE-DpSOcF1kovx5OqIiEt4-dwJqMZB2pmYRYPs,61
7
+ odoo/addons/product_attachment_zipped_download/models/product_product.py,sha256=zhyRjxoQ-RMNMeaxjuR9XPOc8u8ITqy5TRUBWjDXbBE,757
8
+ odoo/addons/product_attachment_zipped_download/models/product_template.py,sha256=JDNTkPpZHOe46lIEonOShllm8XWwfS182Tq_hPJHnTg,764
9
+ odoo/addons/product_attachment_zipped_download/readme/CONTRIBUTORS.rst,sha256=RV1niSVnS-6n89-SQuTVzN8wXdTzS8rs2k-f8UAFr6Q,86
10
+ odoo/addons/product_attachment_zipped_download/readme/DESCRIPTION.rst,sha256=047uFGBNRXhskJ9doM2pICEjXlGUZ77ziwmG7JkFTJE,100
11
+ odoo/addons/product_attachment_zipped_download/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
12
+ odoo/addons/product_attachment_zipped_download/static/description/index.html,sha256=D_vvZQVTlPq7geJXv2B16s0GUKfnSEGYykDj22rHJ-c,12608
13
+ odoo/addons/product_attachment_zipped_download/tests/__init__.py,sha256=Nq0l6DHmH2w2S36Svop3fRrS4o_Mce1p458ecrad_Q0,119
14
+ odoo/addons/product_attachment_zipped_download/tests/test_product_attachment_zipped_download.py,sha256=fS6VuO1U5fKeWgJyYPqdC8Deu-4BDwOROUu6ww2CE64,4922
15
+ odoo/addons/product_attachment_zipped_download/views/product_product_views.xml,sha256=TeP1sb_fQmfqqQNIEM80xbiMDEsFH277RUO3Alr1Mp8,561
16
+ odoo/addons/product_attachment_zipped_download/views/product_template_views.xml,sha256=gpBREKdcUvv5ox5pZjUtdoLEh-ayf27TmuwPIx5PM6A,585
17
+ odoo_addon_product_attachment_zipped_download-15.0.1.0.0.1.dist-info/METADATA,sha256=uTyJijhrPXNMDWJC117FLU6GVNdjFStDkFSXt-yvz6M,3972
18
+ odoo_addon_product_attachment_zipped_download-15.0.1.0.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
19
+ odoo_addon_product_attachment_zipped_download-15.0.1.0.0.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
20
+ odoo_addon_product_attachment_zipped_download-15.0.1.0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.43.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+