diff --git a/setup/web_ir_actions_act_window_message/odoo/addons/web_ir_actions_act_window_message b/setup/web_ir_actions_act_window_message/odoo/addons/web_ir_actions_act_window_message new file mode 120000 index 000000000..9ba0c510a --- /dev/null +++ b/setup/web_ir_actions_act_window_message/odoo/addons/web_ir_actions_act_window_message @@ -0,0 +1 @@ +../../../../web_ir_actions_act_window_message \ No newline at end of file diff --git a/setup/web_ir_actions_act_window_message/setup.py b/setup/web_ir_actions_act_window_message/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/web_ir_actions_act_window_message/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/web_ir_actions_act_window_message/README.rst b/web_ir_actions_act_window_message/README.rst new file mode 100644 index 000000000..73d5c905e --- /dev/null +++ b/web_ir_actions_act_window_message/README.rst @@ -0,0 +1,132 @@ +========================= +Client side message boxes +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/12.0/web_ir_actions_act_window_message + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_ir_actions_act_window_message + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/162/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to show a message popup on the client side as result of a button. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Depend on this module and return + +.. code:: python + + { + 'type': 'ir.actions.act_window.message', + 'title': _('My title'), + 'message': _('My message'), + # optional title of the close button, if not set, will be _('Close') + # if set False, no close button will be shown + # you can create your own close button with an action of type + # ir.actions.act_window_close + 'close_button_title': 'Make this window go away', + # Use HTML instead of text + 'is_html_message': True, + # this is an optional list of buttons to show + 'buttons': [ + # a button can be any action (also ir.actions.report.xml et al) + { + 'type': 'ir.actions.act_window', + 'name': 'All customers', + 'res_model': 'res.partner', + 'view_mode': 'form', + 'views': [[False, 'list'], [False, 'form']], + 'domain': [('customer', '=', True)], + }, + # or if type == method, you need to pass a model, a method name and + # parameters + { + 'type': 'method', + 'name': _('Yes, do it'), + 'model': self._name, + 'method': 'myfunction', + # list of arguments to pass positionally + 'args': [self.ids], + # dictionary of keyword arguments + 'kwargs': {'force': True}, + # button style + 'classes': 'btn-primary', + } + ] + } + +You are responsible for translating the messages. + +Known issues / Roadmap +====================== + +* add `message_type` to differenciate between warnings, errors, etc. +* have one `message_type` to show a nonmodal warning on top right + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Therp BV +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Holger Brunn +* Zakaria Makrelouf (ACSONE SA/NV) +* Benjamin Willig (ACSONE SA/NV) +* Ioan Galan (Studio73) +* Abraham Anes (Studio73) + +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_ir_actions_act_window_message/__init__.py b/web_ir_actions_act_window_message/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/web_ir_actions_act_window_message/__manifest__.py b/web_ir_actions_act_window_message/__manifest__.py new file mode 100644 index 000000000..3742c30ec --- /dev/null +++ b/web_ir_actions_act_window_message/__manifest__.py @@ -0,0 +1,13 @@ +# Copyright 2017 Therp BV, ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Client side message boxes", + "version": "13.0.1.0.0", + "author": "Therp BV, " "ACSONE SA/NV, " "Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Hidden/Dependency", + "summary": "Show a message box to users", + "depends": ["web"], + "data": ["views/templates.xml"], + "qweb": ["static/src/xml/web_ir_actions_act_window_message.xml"], +} diff --git a/web_ir_actions_act_window_message/i18n/ar.po b/web_ir_actions_act_window_message/i18n/ar.po new file mode 100644 index 000000000..c1c23bb1a --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/ar.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "إغلاق" diff --git a/web_ir_actions_act_window_message/i18n/de.po b/web_ir_actions_act_window_message/i18n/de.po new file mode 100644 index 000000000..3111186f5 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/de.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Schließen" diff --git a/web_ir_actions_act_window_message/i18n/es.po b/web_ir_actions_act_window_message/i18n/es.po new file mode 100644 index 000000000..8512f9409 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/es.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\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" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Cerrar" diff --git a/web_ir_actions_act_window_message/i18n/eu.po b/web_ir_actions_act_window_message/i18n/eu.po new file mode 100644 index 000000000..aaf180b71 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/eu.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Basque (https://www.transifex.com/oca/teams/23907/eu/)\n" +"Language: eu\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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Itxi" diff --git a/web_ir_actions_act_window_message/i18n/fi.po b/web_ir_actions_act_window_message/i18n/fi.po new file mode 100644 index 000000000..c51adb4f8 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/fi.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Sulje" diff --git a/web_ir_actions_act_window_message/i18n/fr.po b/web_ir_actions_act_window_message/i18n/fr.po new file mode 100644 index 000000000..b7fc8cb8d --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/fr.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Fermer" diff --git a/web_ir_actions_act_window_message/i18n/hr.po b/web_ir_actions_act_window_message/i18n/hr.po new file mode 100644 index 000000000..6549b1114 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/hr.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Zatvori" diff --git a/web_ir_actions_act_window_message/i18n/it.po b/web_ir_actions_act_window_message/i18n/it.po new file mode 100644 index 000000000..cb47c6ca4 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/it.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\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" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Chiudi" diff --git a/web_ir_actions_act_window_message/i18n/nl.po b/web_ir_actions_act_window_message/i18n/nl.po new file mode 100644 index 000000000..4897bb136 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/nl.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: 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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Sluiten" diff --git a/web_ir_actions_act_window_message/i18n/nl_NL.po b/web_ir_actions_act_window_message/i18n/nl_NL.po new file mode 100644 index 000000000..cd8be4f93 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/nl_NL.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-22 08:27+0000\n" +"PO-Revision-Date: 2017-06-22 08:27+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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Sluiten" diff --git a/web_ir_actions_act_window_message/i18n/pt.po b/web_ir_actions_act_window_message/i18n/pt.po new file mode 100644 index 000000000..72e46296a --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/pt.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# Pedro Castro Silva , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: Pedro Castro Silva , 2017\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\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" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Fechar" diff --git a/web_ir_actions_act_window_message/i18n/pt_BR.po b/web_ir_actions_act_window_message/i18n/pt_BR.po new file mode 100644 index 000000000..2be863bb8 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/pt_BR.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Fechar" diff --git a/web_ir_actions_act_window_message/i18n/ro.po b/web_ir_actions_act_window_message/i18n/ro.po new file mode 100644 index 000000000..9ca9e48ee --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/ro.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# Dorin Hongu , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-03 03:50+0000\n" +"PO-Revision-Date: 2018-01-03 03:50+0000\n" +"Last-Translator: Dorin Hongu , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1));\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Închide" diff --git a/web_ir_actions_act_window_message/i18n/sl.po b/web_ir_actions_act_window_message/i18n/sl.po new file mode 100644 index 000000000..be01d3952 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/sl.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: web_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Zaključi" diff --git a/web_ir_actions_act_window_message/i18n/tr.po b/web_ir_actions_act_window_message/i18n/tr.po new file mode 100644 index 000000000..d00e66847 --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/tr.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-02 09:52+0000\n" +"PO-Revision-Date: 2017-06-02 09:52+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "Kapat" diff --git a/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot b/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot new file mode 100644 index 000000000..4e9bada5a --- /dev/null +++ b/web_ir_actions_act_window_message/i18n/web_ir_actions_act_window_message.pot @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_ir_actions_act_window_message +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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_ir_actions_act_window_message +#. openerp-web +#: code:addons/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js:29 +#, python-format +msgid "Close" +msgstr "" + diff --git a/web_ir_actions_act_window_message/readme/CONTRIBUTORS.rst b/web_ir_actions_act_window_message/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..7b22f2ca0 --- /dev/null +++ b/web_ir_actions_act_window_message/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Holger Brunn +* Zakaria Makrelouf (ACSONE SA/NV) +* Benjamin Willig (ACSONE SA/NV) +* Ioan Galan (Studio73) +* Abraham Anes (Studio73) diff --git a/web_ir_actions_act_window_message/readme/DESCRIPTION.rst b/web_ir_actions_act_window_message/readme/DESCRIPTION.rst new file mode 100644 index 000000000..1223482e3 --- /dev/null +++ b/web_ir_actions_act_window_message/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to show a message popup on the client side as result of a button. diff --git a/web_ir_actions_act_window_message/readme/ROADMAP.rst b/web_ir_actions_act_window_message/readme/ROADMAP.rst new file mode 100644 index 000000000..1a49589d6 --- /dev/null +++ b/web_ir_actions_act_window_message/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +* add `message_type` to differenciate between warnings, errors, etc. +* have one `message_type` to show a nonmodal warning on top right diff --git a/web_ir_actions_act_window_message/readme/USAGE.rst b/web_ir_actions_act_window_message/readme/USAGE.rst new file mode 100644 index 000000000..3f34ff7ce --- /dev/null +++ b/web_ir_actions_act_window_message/readme/USAGE.rst @@ -0,0 +1,44 @@ +Depend on this module and return + +.. code:: python + + { + 'type': 'ir.actions.act_window.message', + 'title': _('My title'), + 'message': _('My message'), + # optional title of the close button, if not set, will be _('Close') + # if set False, no close button will be shown + # you can create your own close button with an action of type + # ir.actions.act_window_close + 'close_button_title': 'Make this window go away', + # Use HTML instead of text + 'is_html_message': True, + # this is an optional list of buttons to show + 'buttons': [ + # a button can be any action (also ir.actions.report.xml et al) + { + 'type': 'ir.actions.act_window', + 'name': 'All customers', + 'res_model': 'res.partner', + 'view_mode': 'form', + 'views': [[False, 'list'], [False, 'form']], + 'domain': [('customer', '=', True)], + }, + # or if type == method, you need to pass a model, a method name and + # parameters + { + 'type': 'method', + 'name': _('Yes, do it'), + 'model': self._name, + 'method': 'myfunction', + # list of arguments to pass positionally + 'args': [self.ids], + # dictionary of keyword arguments + 'kwargs': {'force': True}, + # button style + 'classes': 'btn-primary', + } + ] + } + +You are responsible for translating the messages. diff --git a/web_ir_actions_act_window_message/static/description/icon.png b/web_ir_actions_act_window_message/static/description/icon.png new file mode 100644 index 000000000..989658727 Binary files /dev/null and b/web_ir_actions_act_window_message/static/description/icon.png differ diff --git a/web_ir_actions_act_window_message/static/description/index.html b/web_ir_actions_act_window_message/static/description/index.html new file mode 100644 index 000000000..166c94392 --- /dev/null +++ b/web_ir_actions_act_window_message/static/description/index.html @@ -0,0 +1,478 @@ + + + + + + +Client side message boxes + + + +
+

Client side message boxes

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

This module allows to show a message popup on the client side as result of a button.

+

Table of contents

+ +
+

Usage

+

Depend on this module and return

+
+{
+    'type': 'ir.actions.act_window.message',
+    'title': _('My title'),
+    'message': _('My message'),
+    # optional title of the close button, if not set, will be _('Close')
+    # if set False, no close button will be shown
+    # you can create your own close button with an action of type
+    # ir.actions.act_window_close
+    'close_button_title': 'Make this window go away',
+    # Use HTML instead of text
+    'is_html_message': True,
+    # this is an optional list of buttons to show
+    'buttons': [
+        # a button can be any action (also ir.actions.report.xml et al)
+        {
+            'type': 'ir.actions.act_window',
+            'name': 'All customers',
+            'res_model': 'res.partner',
+            'view_mode': 'form',
+            'views': [[False, 'list'], [False, 'form']],
+            'domain': [('customer', '=', True)],
+        },
+        # or if type == method, you need to pass a model, a method name and
+        # parameters
+        {
+            'type': 'method',
+            'name': _('Yes, do it'),
+            'model': self._name,
+            'method': 'myfunction',
+            # list of arguments to pass positionally
+            'args': [self.ids],
+            # dictionary of keyword arguments
+            'kwargs': {'force': True},
+            # button style
+            'classes': 'btn-primary',
+        }
+    ]
+}
+
+

You are responsible for translating the messages.

+
+
+

Known issues / Roadmap

+
    +
  • add message_type to differenciate between warnings, errors, etc.
  • +
  • have one message_type to show a nonmodal warning on top right
  • +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Therp BV
  • +
  • ACSONE SA/NV
  • +
+
+
+

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_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js new file mode 100644 index 000000000..840dd4480 --- /dev/null +++ b/web_ir_actions_act_window_message/static/src/js/web_ir_actions_act_window_message.js @@ -0,0 +1,109 @@ +/* Copyright 2017 Therp BV, ACSONE SA/NV + * * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +odoo.define("web.web_ir_actions_act_window_message", function(require) { + "use strict"; + + var ActionManager = require("web.ActionManager"), + core = require("web.core"), + Dialog = require("web.Dialog"); + + var _t = core._t; + + ActionManager.include({ + _handleAction: function(action, options) { + if (action.type === "ir.actions.act_window.message") { + return this._executeWindowMessageAction(action, options); + } + return this._super.apply(this, arguments); + }, + _executeWindowMessageAction: function(action, options) { + var self = this, + buttons = []; + + if (action.close_button_title !== false) { + buttons.push({ + text: action.close_button_title || _t("Close"), + click: function() { + // Refresh the view before closing the dialog + var controller = self.getCurrentController(); + if (controller && controller.widget) { + controller.widget.reload(); + } + }, + classes: "btn-default", + }); + } + + var is_html = action.is_html_message === true; + var content_properties = {}; + + if (is_html) { + content_properties = { + html: action.message, + }; + } else { + content_properties = { + text: action.message, + css: { + "white-space": "pre-line", + }, + }; + } + + var dialog = new Dialog( + this, + _.extend( + { + size: "medium", + title: action.title, + $content: $("
", content_properties), + buttons: buttons.concat( + this.ir_actions_act_window_message_get_buttons( + action, + function() { + dialog.close(); + } + ) + ), + }, + options + ) + ); + return dialog.open()._opened; + }, + ir_actions_act_window_message_get_buttons: function(action, close_func) { + // Return an array of button definitions from action + var self = this; + return _.map(action.buttons || [], function(button_definition) { + return { + text: button_definition.name || "No name set", + classes: button_definition.classes || "btn-default", + click: function() { + if (button_definition.type == "method") { + self._rpc({ + model: button_definition.model, + method: button_definition.method, + args: button_definition.args, + kwargs: button_definition.kwargs, + }).then(function(result) { + if (_.isObject(result)) { + self.do_action(result); + } + // Always refresh the view after the action + // ex: action updates a status + var controller = self.getCurrentController(); + if (controller && controller.widget) { + controller.widget.reload(); + } + }); + } else { + self.do_action(button_definition); + } + close_func(); + }, + }; + }); + }, + }); +}); diff --git a/web_ir_actions_act_window_message/static/src/xml/web_ir_actions_act_window_message.xml b/web_ir_actions_act_window_message/static/src/xml/web_ir_actions_act_window_message.xml new file mode 100644 index 000000000..5d6944290 --- /dev/null +++ b/web_ir_actions_act_window_message/static/src/xml/web_ir_actions_act_window_message.xml @@ -0,0 +1,7 @@ + +
+
+ +
+
+
diff --git a/web_ir_actions_act_window_message/views/templates.xml b/web_ir_actions_act_window_message/views/templates.xml new file mode 100644 index 000000000..2a71d18af --- /dev/null +++ b/web_ir_actions_act_window_message/views/templates.xml @@ -0,0 +1,17 @@ + + + +