diff --git a/setup/web_environment_ribbon/odoo/addons/web_environment_ribbon b/setup/web_environment_ribbon/odoo/addons/web_environment_ribbon new file mode 120000 index 000000000000..18823096a500 --- /dev/null +++ b/setup/web_environment_ribbon/odoo/addons/web_environment_ribbon @@ -0,0 +1 @@ +../../../../web_environment_ribbon \ No newline at end of file diff --git a/setup/web_environment_ribbon/setup.py b/setup/web_environment_ribbon/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/web_environment_ribbon/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/web_environment_ribbon/README.rst b/web_environment_ribbon/README.rst new file mode 100644 index 000000000000..d7b1f53ec46e --- /dev/null +++ b/web_environment_ribbon/README.rst @@ -0,0 +1,98 @@ +====================== +Web Environment Ribbon +====================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/16.0/web_environment_ribbon + :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_environment_ribbon + :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/16.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Mark a Test Environment with a red ribbon on the top left corner in every page + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +* You can change the ribbon's name ("TEST") by editing the default system + parameter "ribbon.name" (in the menu Settings > Parameters > System + Parameters) To hide the ribbon, set this parameter to "False" or delete it. +* You can customize the ribbon color and background color through system + parameters: "ribbon.color", "ribbon.background.color". Fill with valid CSS + colors or just set to "False" to use default values. +* You can add the database name in the ribbon by adding "{db_name}" in the + system parameter "ribbon.name". + +Usage +===== + +To use this module, you need only to install it. After installation, a red +ribbon will be visible on top left corner of every Odoo backend page + +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 +~~~~~~~ + +* Francesco OpenCode Apruzzese +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Francesco Apruzzese +* Javi Melendez +* Antonio Espinosa +* Thomas Binsfeld +* Xavier Jiménez +* Dennis Sluijk +* Eric Lembregts + +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_environment_ribbon/__init__.py b/web_environment_ribbon/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/web_environment_ribbon/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/web_environment_ribbon/__manifest__.py b/web_environment_ribbon/__manifest__.py new file mode 100644 index 000000000000..9d99f184749d --- /dev/null +++ b/web_environment_ribbon/__manifest__.py @@ -0,0 +1,27 @@ +# Copyright 2015 Francesco OpenCode Apruzzese +# Copyright 2016 Antonio Espinosa +# Copyright 2017 Thomas Binsfeld +# Copyright 2017 Xavier Jiménez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Web Environment Ribbon", + "version": "16.0.1.0.0", + "category": "Web", + "author": "Francesco OpenCode Apruzzese, " + "Tecnativa, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "license": "AGPL-3", + "depends": ["web"], + "data": [ + "data/ribbon_data.xml", + ], + "auto_install": False, + "installable": True, + "assets": { + "web.assets_common": [ + "web_environment_ribbon/static/**/*", + ], + }, +} diff --git a/web_environment_ribbon/data/ribbon_data.xml b/web_environment_ribbon/data/ribbon_data.xml new file mode 100644 index 000000000000..72a5024909f6 --- /dev/null +++ b/web_environment_ribbon/data/ribbon_data.xml @@ -0,0 +1,20 @@ + + + + + + ribbon.name + ({db_name})]]> + + + + ribbon.color + #f0f0f0 + + + + ribbon.background.color + rgba(255,0,0,.6) + + diff --git a/web_environment_ribbon/i18n/ca.po b/web_environment_ribbon/i18n/ca.po new file mode 100644 index 000000000000..6011c8b8b878 --- /dev/null +++ b/web_environment_ribbon/i18n/ca.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-02 22:13+0000\n" +"Last-Translator: eduardgm \n" +"Language-Team: none\n" +"Language: ca\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.10\n" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Nom mostrat" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Última modificació el" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Backend \"Web Environment Ribbon\"" diff --git a/web_environment_ribbon/i18n/de.po b/web_environment_ribbon/i18n/de.po new file mode 100644 index 000000000000..69c8fd29a5fb --- /dev/null +++ b/web_environment_ribbon/i18n/de.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# Niki Waibel , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2020-07-22 12:19+0000\n" +"Last-Translator: c2cdidier \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" +"X-Generator: Weblate 3.10\n" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Anzeigename" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Zuletzt geändert am" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Web-Umgebung Ribbon-Backend" diff --git a/web_environment_ribbon/i18n/es.po b/web_environment_ribbon/i18n/es.po new file mode 100644 index 000000000000..f38990ccdba2 --- /dev/null +++ b/web_environment_ribbon/i18n/es.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-08-04 17:44+0000\n" +"Last-Translator: eduardgm \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 3.7.1\n" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Backend \"Web Environment Ribbon\"" diff --git a/web_environment_ribbon/i18n/fr.po b/web_environment_ribbon/i18n/fr.po new file mode 100644 index 000000000000..5125212c81b1 --- /dev/null +++ b/web_environment_ribbon/i18n/fr.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# OCA Transbot , 2017 +# Quentin THEURET , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-26 02:44+0000\n" +"PO-Revision-Date: 2017-07-26 02:44+0000\n" +"Last-Translator: Quentin THEURET , 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_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Backend du bandeau de l'environnement Web" diff --git a/web_environment_ribbon/i18n/hr.po b/web_environment_ribbon/i18n/hr.po new file mode 100644 index 000000000000..836e2311b6d6 --- /dev/null +++ b/web_environment_ribbon/i18n/hr.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# 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:06+0000\n" +"PO-Revision-Date: 2017-07-13 16:06+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_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Naziv za prikaz" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Zadnje modificirano" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" diff --git a/web_environment_ribbon/i18n/nl.po b/web_environment_ribbon/i18n/nl.po new file mode 100644 index 000000000000..4185a0aa04ab --- /dev/null +++ b/web_environment_ribbon/i18n/nl.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-05-17 20:47+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Weergavenaam" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Laatst Gewijzigd op" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Web Environment Ribbon Backend" diff --git a/web_environment_ribbon/i18n/nl_NL.po b/web_environment_ribbon/i18n/nl_NL.po new file mode 100644 index 000000000000..d66b5b3f552f --- /dev/null +++ b/web_environment_ribbon/i18n/nl_NL.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2021-04-22 15:47+0000\n" +"Last-Translator: Bosd \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" +"X-Generator: Weblate 4.3.2\n" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Weergavenaam" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Laatst bijgewerkt op" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" diff --git a/web_environment_ribbon/i18n/pt.po b/web_environment_ribbon/i18n/pt.po new file mode 100644 index 000000000000..486684bc1755 --- /dev/null +++ b/web_environment_ribbon/i18n/pt.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-08-12 11:44+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.7.1\n" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Nome a Exibir" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Última Modificação em" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" diff --git a/web_environment_ribbon/i18n/pt_BR.po b/web_environment_ribbon/i18n/pt_BR.po new file mode 100644 index 000000000000..539afa617536 --- /dev/null +++ b/web_environment_ribbon/i18n/pt_BR.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# Rodrigo de Almeida Sottomaior Macedo , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2018-08-03 12:34+0000\n" +"Last-Translator: Rodrigo Macedo \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" +"X-Generator: Weblate 3.1.1\n" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "Exibir Nome" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "Identificação" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "Última Modificação em" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Back-end da fita do ambiente da Web" diff --git a/web_environment_ribbon/i18n/sl.po b/web_environment_ribbon/i18n/sl.po new file mode 100644 index 000000000000..3790712db929 --- /dev/null +++ b/web_environment_ribbon/i18n/sl.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-13 16:06+0000\n" +"PO-Revision-Date: 2017-07-13 16:06+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_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" diff --git a/web_environment_ribbon/i18n/web_environment_ribbon.pot b/web_environment_ribbon/i18n/web_environment_ribbon.pot new file mode 100644 index 000000000000..57b08246e71f --- /dev/null +++ b/web_environment_ribbon/i18n/web_environment_ribbon.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "" diff --git a/web_environment_ribbon/i18n/zh_CN.po b/web_environment_ribbon/i18n/zh_CN.po new file mode 100644 index 000000000000..6b6072093e56 --- /dev/null +++ b/web_environment_ribbon/i18n/zh_CN.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_environment_ribbon +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-01 12:52+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_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__display_name +msgid "Display Name" +msgstr "显示名称" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend__id +msgid "ID" +msgstr "ID" + +#. module: web_environment_ribbon +#: model:ir.model.fields,field_description:web_environment_ribbon.field_web_environment_ribbon_backend____last_update +msgid "Last Modified on" +msgstr "最后修改时间" + +#. module: web_environment_ribbon +#: model:ir.model,name:web_environment_ribbon.model_web_environment_ribbon_backend +msgid "Web Environment Ribbon Backend" +msgstr "Web环境功能区后台" diff --git a/web_environment_ribbon/models/__init__.py b/web_environment_ribbon/models/__init__.py new file mode 100644 index 000000000000..18368b473359 --- /dev/null +++ b/web_environment_ribbon/models/__init__.py @@ -0,0 +1 @@ +from . import web_environment_ribbon_backend diff --git a/web_environment_ribbon/models/web_environment_ribbon_backend.py b/web_environment_ribbon/models/web_environment_ribbon_backend.py new file mode 100644 index 000000000000..5932d7b32d13 --- /dev/null +++ b/web_environment_ribbon/models/web_environment_ribbon_backend.py @@ -0,0 +1,36 @@ +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class WebEnvironmentRibbonBackend(models.AbstractModel): + + _name = "web.environment.ribbon.backend" + _description = "Web Environment Ribbon Backend" + + @api.model + def _prepare_ribbon_format_vals(self): + return {"db_name": self.env.cr.dbname} + + @api.model + def _prepare_ribbon_name(self): + name_tmpl = self.env["ir.config_parameter"].sudo().get_param("ribbon.name") + vals = self._prepare_ribbon_format_vals() + return name_tmpl and name_tmpl.format(**vals) or name_tmpl + + @api.model + def get_environment_ribbon(self): + """ + This method returns the ribbon data from ir config parameters + :return: dictionary + """ + ir_config_model = self.env["ir.config_parameter"] + name = self._prepare_ribbon_name() + return { + "name": name, + "color": ir_config_model.sudo().get_param("ribbon.color"), + "background_color": ir_config_model.sudo().get_param( + "ribbon.background.color" + ), + } diff --git a/web_environment_ribbon/readme/CONFIGURE.rst b/web_environment_ribbon/readme/CONFIGURE.rst new file mode 100644 index 000000000000..8542c72e497a --- /dev/null +++ b/web_environment_ribbon/readme/CONFIGURE.rst @@ -0,0 +1,8 @@ +* You can change the ribbon's name ("TEST") by editing the default system + parameter "ribbon.name" (in the menu Settings > Parameters > System + Parameters) To hide the ribbon, set this parameter to "False" or delete it. +* You can customize the ribbon color and background color through system + parameters: "ribbon.color", "ribbon.background.color". Fill with valid CSS + colors or just set to "False" to use default values. +* You can add the database name in the ribbon by adding "{db_name}" in the + system parameter "ribbon.name". diff --git a/web_environment_ribbon/readme/CONTRIBUTORS.rst b/web_environment_ribbon/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..257e450dc6df --- /dev/null +++ b/web_environment_ribbon/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Francesco Apruzzese +* Javi Melendez +* Antonio Espinosa +* Thomas Binsfeld +* Xavier Jiménez +* Dennis Sluijk +* Eric Lembregts diff --git a/web_environment_ribbon/readme/DESCRIPTION.rst b/web_environment_ribbon/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..c52ab9b575b4 --- /dev/null +++ b/web_environment_ribbon/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Mark a Test Environment with a red ribbon on the top left corner in every page diff --git a/web_environment_ribbon/readme/USAGE.rst b/web_environment_ribbon/readme/USAGE.rst new file mode 100644 index 000000000000..408d88cd2498 --- /dev/null +++ b/web_environment_ribbon/readme/USAGE.rst @@ -0,0 +1,2 @@ +To use this module, you need only to install it. After installation, a red +ribbon will be visible on top left corner of every Odoo backend page diff --git a/web_environment_ribbon/static/description/icon.png b/web_environment_ribbon/static/description/icon.png new file mode 100644 index 000000000000..78b52ae920d6 Binary files /dev/null and b/web_environment_ribbon/static/description/icon.png differ diff --git a/web_environment_ribbon/static/description/index.html b/web_environment_ribbon/static/description/index.html new file mode 100644 index 000000000000..ecc5378fc630 --- /dev/null +++ b/web_environment_ribbon/static/description/index.html @@ -0,0 +1,446 @@ + + + + + + +Web Environment Ribbon + + + +
+

Web Environment Ribbon

+ + +

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

+

Mark a Test Environment with a red ribbon on the top left corner in every page

+

Table of contents

+ +
+

Configuration

+
    +
  • You can change the ribbon’s name (“TEST”) by editing the default system +parameter “ribbon.name” (in the menu Settings > Parameters > System +Parameters) To hide the ribbon, set this parameter to “False” or delete it.
  • +
  • You can customize the ribbon color and background color through system +parameters: “ribbon.color”, “ribbon.background.color”. Fill with valid CSS +colors or just set to “False” to use default values.
  • +
  • You can add the database name in the ribbon by adding “{db_name}” in the +system parameter “ribbon.name”.
  • +
+
+
+

Usage

+

To use this module, you need only to install it. After installation, a red +ribbon will be visible on top left corner of every Odoo backend page

+
+
+

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

+
    +
  • Francesco OpenCode Apruzzese
  • +
  • Tecnativa
  • +
+
+
+

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_environment_ribbon/static/description/screenshot.png b/web_environment_ribbon/static/description/screenshot.png new file mode 100644 index 000000000000..30245656d1b2 Binary files /dev/null and b/web_environment_ribbon/static/description/screenshot.png differ diff --git a/web_environment_ribbon/static/src/css/ribbon.css b/web_environment_ribbon/static/src/css/ribbon.css new file mode 100644 index 000000000000..cbf4a40d5fbd --- /dev/null +++ b/web_environment_ribbon/static/src/css/ribbon.css @@ -0,0 +1,36 @@ +/* Copyright 2015 Francesco OpenCode Apruzzese + Copyright 2017 Thomas Binsfeld + Copyright 2021 Andreas Perhab + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +.test-ribbon { + width: 300px; + top: 25px; + left: -100px; + text-align: center; + padding: 10px; + line-height: 20px; + letter-spacing: 1px; + color: #f0f0f0; + -webkit-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg); + z-index: 9999; + position: fixed; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); + background: rgba(255, 0, 0, 0.6); + pointer-events: none; +} + +.test-ribbon b { + font-size: 20px; +} + +header:hover ~ .test-ribbon, +nav:hover ~ .test-ribbon { + /* Ease out ribbon when user is using the navigation in Odoo */ + opacity: 0; + transition: 0.2s ease; +} diff --git a/web_environment_ribbon/static/src/js/ribbon.js b/web_environment_ribbon/static/src/js/ribbon.js new file mode 100644 index 000000000000..67a45712375c --- /dev/null +++ b/web_environment_ribbon/static/src/js/ribbon.js @@ -0,0 +1,62 @@ +/* Copyright 2015 Sylvain Calador + Copyright 2015 Javi Melendez + Copyright 2016 Antonio Espinosa + Copyright 2017 Thomas Binsfeld + Copyright 2017 Xavier Jiménez + License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +odoo.define("web_environment_ribbon.ribbon", function (require) { + "use strict"; + var rpc = require("web.rpc"); + var core = require("web.core"); + + // Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/ + function validStrColour(strToTest) { + if (strToTest === "") { + return false; + } + if (strToTest === "inherit") { + return true; + } + if (strToTest === "transparent") { + return true; + } + var image = document.createElement("img"); + image.style.color = "rgb(0, 0, 0)"; + image.style.color = strToTest; + if (image.style.color !== "rgb(0, 0, 0)") { + return true; + } + image.style.color = "rgb(255, 255, 255)"; + image.style.color = strToTest; + return image.style.color !== "rgb(255, 255, 255)"; + } + + core.bus.on("web_client_ready", null, function () { + var ribbon = $('