diff --git a/setup/web_widget_image_download/odoo/addons/web_widget_image_download b/setup/web_widget_image_download/odoo/addons/web_widget_image_download new file mode 120000 index 000000000000..ab050eae885f --- /dev/null +++ b/setup/web_widget_image_download/odoo/addons/web_widget_image_download @@ -0,0 +1 @@ +../../../../web_widget_image_download \ No newline at end of file diff --git a/setup/web_widget_image_download/setup.py b/setup/web_widget_image_download/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/web_widget_image_download/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/web_widget_image_download/README.rst b/web_widget_image_download/README.rst new file mode 100644 index 000000000000..1edb0737ce0e --- /dev/null +++ b/web_widget_image_download/README.rst @@ -0,0 +1,98 @@ +=========================== +Web Widget - Image Download +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:01e27e70406c021c12f0ccba353c64aea71f52d5f06cd7eee48668ad281a029d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/16.0/web_widget_image_download + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_image_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/web&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module was written to extend the functionality of the image widget and +allows to download it. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, an example path is: + +#. Go to the section `Contacts`. +#. Click on a contact. +#. Edit the contact. +#. Click the `Download` button (on the top left corner). + +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 +* Kaushal Prajapati + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Flavio Corpa + * Jairo Llopis + * Pedro M. Baeza + * Ernesto Tejeda + * Alexandre Díaz + +* Kaushal Prajapati +* Peerapong Supasompob +* Manuel Regidor + +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. + +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_widget_image_download/__init__.py b/web_widget_image_download/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_widget_image_download/__manifest__.py b/web_widget_image_download/__manifest__.py new file mode 100644 index 000000000000..dfecfebb38e3 --- /dev/null +++ b/web_widget_image_download/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2016 Flavio Corpa +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). +{ + "name": "Web Widget - Image Download", + "summary": "Allows to download any image from its widget", + "version": "16.0.1.0.0", + "category": "web", + "website": "https://github.com/OCA/web", + "author": "Tecnativa, Odoo Community Association (OCA), Kaushal Prajapati", + "license": "LGPL-3", + "application": False, + "installable": True, + "depends": ["web"], + "assets": { + "web.assets_backend": [ + "web_widget_image_download/static/src/components/*", + "web_widget_image_download/static/src/xml/*", + ], + }, +} diff --git a/web_widget_image_download/i18n/es.po b/web_widget_image_download/i18n/es.po new file mode 100644 index 000000000000..fb25e0249c69 --- /dev/null +++ b/web_widget_image_download/i18n/es.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_image_download +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-02-17 14:45+0000\n" +"Last-Translator: claudiagn \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_widget_image_download +#. openerp-web +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#, python-format +msgid "Download" +msgstr "Descargar" diff --git a/web_widget_image_download/i18n/hr.po b/web_widget_image_download/i18n/hr.po new file mode 100644 index 000000000000..0b71bcf137fd --- /dev/null +++ b/web_widget_image_download/i18n/hr.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_image_download +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:07+0000\n" +"PO-Revision-Date: 2017-07-13 16:07+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: web_widget_image_download +#. openerp-web +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#, python-format +msgid "Download" +msgstr "Preuzimanje" diff --git a/web_widget_image_download/i18n/it.po b/web_widget_image_download/i18n/it.po new file mode 100644 index 000000000000..f60afb87059f --- /dev/null +++ b/web_widget_image_download/i18n/it.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_image_download +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-09-04 18:36+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: web_widget_image_download +#. openerp-web +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#, python-format +msgid "Download" +msgstr "Scarica" diff --git a/web_widget_image_download/i18n/lt.po b/web_widget_image_download/i18n/lt.po new file mode 100644 index 000000000000..1828d197a14e --- /dev/null +++ b/web_widget_image_download/i18n/lt.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_image_download +# +# Translators: +# Viktoras Norkus , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-25 01:58+0000\n" +"PO-Revision-Date: 2018-01-25 01:58+0000\n" +"Last-Translator: Viktoras Norkus , 2018\n" +"Language-Team: Lithuanian (https://www.transifex.com/oca/teams/23907/lt/)\n" +"Language: lt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" +"%100<10 || n%100>=20) ? 1 : 2);\n" + +#. module: web_widget_image_download +#. openerp-web +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#, python-format +msgid "Download" +msgstr "Atsisiūsti" diff --git a/web_widget_image_download/i18n/nl_NL.po b/web_widget_image_download/i18n/nl_NL.po new file mode 100644 index 000000000000..0667befc1eb2 --- /dev/null +++ b/web_widget_image_download/i18n/nl_NL.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_image_download +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-01 03:35+0000\n" +"PO-Revision-Date: 2017-07-01 03:35+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_widget_image_download +#. openerp-web +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#, python-format +msgid "Download" +msgstr "Download" diff --git a/web_widget_image_download/i18n/pt.po b/web_widget_image_download/i18n/pt.po new file mode 100644 index 000000000000..83688d0fdbcc --- /dev/null +++ b/web_widget_image_download/i18n/pt.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_image_download +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-11-17 14:35+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.8\n" + +#. module: web_widget_image_download +#. openerp-web +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#, python-format +msgid "Download" +msgstr "Descarregar" diff --git a/web_widget_image_download/i18n/web_widget_image_download.pot b/web_widget_image_download/i18n/web_widget_image_download.pot new file mode 100644 index 000000000000..6b64daaa0464 --- /dev/null +++ b/web_widget_image_download/i18n/web_widget_image_download.pot @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_image_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: web_widget_image_download +#. openerp-web +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#, python-format +msgid "Download" +msgstr "" diff --git a/web_widget_image_download/i18n/zh_CN.po b/web_widget_image_download/i18n/zh_CN.po new file mode 100644 index 000000000000..9d506dc191b4 --- /dev/null +++ b/web_widget_image_download/i18n/zh_CN.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_image_download +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-01 17:23+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: web_widget_image_download +#. openerp-web +#: code:addons/web_widget_image_download/static/src/xml/web_widget_image_download.xml:0 +#, python-format +msgid "Download" +msgstr "下载" diff --git a/web_widget_image_download/readme/CONTRIBUTORS.rst b/web_widget_image_download/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..36637f4ad628 --- /dev/null +++ b/web_widget_image_download/readme/CONTRIBUTORS.rst @@ -0,0 +1,11 @@ +* `Tecnativa `_: + + * Flavio Corpa + * Jairo Llopis + * Pedro M. Baeza + * Ernesto Tejeda + * Alexandre Díaz + +* Kaushal Prajapati +* Peerapong Supasompob +* Manuel Regidor diff --git a/web_widget_image_download/readme/DESCRIPTION.rst b/web_widget_image_download/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..c4b36dd5c414 --- /dev/null +++ b/web_widget_image_download/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module was written to extend the functionality of the image widget and +allows to download it. diff --git a/web_widget_image_download/readme/USAGE.rst b/web_widget_image_download/readme/USAGE.rst new file mode 100644 index 000000000000..e4cccdbd29b5 --- /dev/null +++ b/web_widget_image_download/readme/USAGE.rst @@ -0,0 +1,6 @@ +To use this module, an example path is: + +#. Go to the section `Contacts`. +#. Click on a contact. +#. Edit the contact. +#. Click the `Download` button (on the top left corner). diff --git a/web_widget_image_download/static/description/icon.png b/web_widget_image_download/static/description/icon.png new file mode 100644 index 000000000000..65dabfc969bb Binary files /dev/null and b/web_widget_image_download/static/description/icon.png differ diff --git a/web_widget_image_download/static/description/index.html b/web_widget_image_download/static/description/index.html new file mode 100644 index 000000000000..70ce7300bb4d --- /dev/null +++ b/web_widget_image_download/static/description/index.html @@ -0,0 +1,443 @@ + + + + + +Web Widget - Image Download + + + +
+

Web Widget - Image Download

+ + +

Beta License: LGPL-3 OCA/web Translate me on Weblate Try me on Runboat

+

This module was written to extend the functionality of the image widget and +allows to download it.

+

Table of contents

+ +
+

Usage

+

To use this module, an example path is:

+
    +
  1. Go to the section Contacts.
  2. +
  3. Click on a contact.
  4. +
  5. Edit the contact.
  6. +
  7. Click the Download button (on the top left corner).
  8. +
+
+
+

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
  • +
  • Kaushal Prajapati
  • +
+
+
+

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/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_widget_image_download/static/src/components/image_field.esm.js b/web_widget_image_download/static/src/components/image_field.esm.js new file mode 100644 index 000000000000..c1d0816a7e15 --- /dev/null +++ b/web_widget_image_download/static/src/components/image_field.esm.js @@ -0,0 +1,21 @@ +/** @odoo-module **/ + +/* Copyright 2016 Flavio Corpa + * Copyright 2016 Jairo Llopis + * Copyright 2024 Manuel Regidor + * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ + +import {patch} from "@web/core/utils/patch"; +import {ImageField} from "@web/views/fields/image/image_field"; + +patch(ImageField.prototype, "web_widget_image_download", { + download() { + const downloadLink = document.createElement("a"); + downloadLink.setAttribute("href", this.getUrl(this.props.name)); + downloadLink.setAttribute("download", ""); + downloadLink.click(); + }, + onFileDownload() { + this.download(); + }, +}); diff --git a/web_widget_image_download/static/src/xml/web_widget_image_download.xml b/web_widget_image_download/static/src/xml/web_widget_image_download.xml new file mode 100644 index 000000000000..1f030b1b1d4b --- /dev/null +++ b/web_widget_image_download/static/src/xml/web_widget_image_download.xml @@ -0,0 +1,29 @@ + + +