Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] product_attachment_zipped_download: Migration to 16.0 #1822

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions product_attachment_zipped_download/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
==================================
Product Attachment Zipped Download
==================================

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

.. |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-OCA%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/16.0/product_attachment_zipped_download
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_attachment_zipped_download
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows the possibility to download attachments in a .zip file of the selected products.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/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/OCA/product-attribute/issues/new?body=module:%20product_attachment_zipped_download%0Aversion:%2016.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
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px
:target: https://github.com/victoralmau
:alt: victoralmau

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-victoralmau|

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/16.0/product_attachment_zipped_download>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions product_attachment_zipped_download/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions product_attachment_zipped_download/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Product Attachment Zipped Download",
"version": "16.0.1.0.0",
"category": "Product Management",
"website": "https://github.com/OCA/product-attribute",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["attachment_zipped_download", "product"],
"data": ["data/ir_actions_server_data.xml"],
"installable": True,
"maintainers": ["victoralmau"],
}
26 changes: 26 additions & 0 deletions product_attachment_zipped_download/data/ir_actions_server_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="action_download_product_product_attachements" model="ir.actions.server">
<field name="name">Download attachments</field>
<field name="model_id" ref="product.model_product_product" />
<field name="binding_model_id" ref="product.model_product_product" />
<field name="binding_view_types">list,form</field>
<field name="state">code</field>
<field name="code">
action = records.action_download_attachments()
</field>
</record>
<record
id="action_download_product_template_attachements"
model="ir.actions.server"
>
<field name="name">Download attachments</field>
<field name="model_id" ref="product.model_product_template" />
<field name="binding_model_id" ref="product.model_product_template" />
<field name="binding_view_types">list,form</field>
<field name="state">code</field>
<field name="code">
action = records.action_download_attachments()
</field>
</record>
</odoo>
35 changes: 35 additions & 0 deletions product_attachment_zipped_download/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_attachment_zipped_download
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-15 07:00+0000\n"
"PO-Revision-Date: 2024-04-15 09:01+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: product_attachment_zipped_download
#: model:ir.actions.server,name:product_attachment_zipped_download.action_download_product_product_attachements
#: model:ir.actions.server,name:product_attachment_zipped_download.action_download_product_template_attachements
msgid "Download attachments"
msgstr "Descargar adjuntos"

#. module: product_attachment_zipped_download
#: model:ir.model,name:product_attachment_zipped_download.model_product_product
#, fuzzy
msgid "Product"
msgstr "Producto"

#. module: product_attachment_zipped_download
#: model:ir.model,name:product_attachment_zipped_download.model_product_template
msgid "Product Template"
msgstr "Plantilla de producto"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_attachment_zipped_download
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: product_attachment_zipped_download
#: model:ir.actions.server,name:product_attachment_zipped_download.action_download_product_product_attachements
#: model:ir.actions.server,name:product_attachment_zipped_download.action_download_product_template_attachements
msgid "Download attachments"
msgstr ""

#. module: product_attachment_zipped_download
#: model:ir.model,name:product_attachment_zipped_download.model_product_product
msgid "Product"
msgstr ""

#. module: product_attachment_zipped_download
#: model:ir.model,name:product_attachment_zipped_download.model_product_template
msgid "Product Template"
msgstr ""
2 changes: 2 additions & 0 deletions product_attachment_zipped_download/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import product_product
from . import product_template
23 changes: 23 additions & 0 deletions product_attachment_zipped_download/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class Productproduct(models.Model):
_name = "product.product"
_inherit = ["product.product", "ir.attachment.action_download"]

def _get_downloadable_attachments(self):
"""Overwrite to get the attachments from template or variants."""
return self.env["ir.attachment"].search(
[
"|",
"&",
("res_model", "=", "product.product"),
("res_id", "in", self.ids),
"&",
("res_model", "=", "product.template"),
("res_id", "in", self.product_tmpl_id.ids),
]
)
23 changes: 23 additions & 0 deletions product_attachment_zipped_download/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class ProductTemplate(models.Model):
_name = "product.template"
_inherit = ["product.template", "ir.attachment.action_download"]

def _get_downloadable_attachments(self):
"""Overwrite to get the attachments from template or variants."""
return self.env["ir.attachment"].search(
[
"|",
"&",
("res_model", "=", "product.product"),
("res_id", "in", self.product_variant_ids.ids),
"&",
("res_model", "=", "product.template"),
("res_id", "in", self.ids),
]
)
4 changes: 4 additions & 0 deletions product_attachment_zipped_download/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza
1 change: 1 addition & 0 deletions product_attachment_zipped_download/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows the possibility to download attachments in a .zip file of the selected products.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading