diff --git a/web_environment_ribbon/README.rst b/web_environment_ribbon/README.rst
index d1380d305..cc7622bf6 100644
--- a/web_environment_ribbon/README.rst
+++ b/web_environment_ribbon/README.rst
@@ -17,13 +17,13 @@ Web Environment Ribbon
: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/17.0/web_environment_ribbon
+ :target: https://github.com/OCA/web/tree/18.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-17-0/web-17-0-web_environment_ribbon
+ :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_environment_ribbon
: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=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -65,7 +65,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -102,6 +102,6 @@ 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.
+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/__manifest__.py b/web_environment_ribbon/__manifest__.py
index fd5eae994..35094f239 100644
--- a/web_environment_ribbon/__manifest__.py
+++ b/web_environment_ribbon/__manifest__.py
@@ -6,7 +6,7 @@
{
"name": "Web Environment Ribbon",
- "version": "17.0.1.0.2",
+ "version": "18.0.1.0.0",
"category": "Web",
"author": "Francesco OpenCode Apruzzese, "
"Tecnativa, "
diff --git a/web_environment_ribbon/static/description/index.html b/web_environment_ribbon/static/description/index.html
index c32f41cee..20fd192c6 100644
--- a/web_environment_ribbon/static/description/index.html
+++ b/web_environment_ribbon/static/description/index.html
@@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9a08035950044b08a0f55bd6ff0b05de48c9cb8abd74df63a5579dbf1510048b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

Mark a Test Environment with a red ribbon on the top left corner in
every page
Table of contents
@@ -414,7 +414,7 @@ red ribbon will be visible on top left corner of every Odoo backend page
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -447,7 +447,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
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.
+
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/src/components/environment_ribbon/ribbon.esm.js b/web_environment_ribbon/static/src/components/environment_ribbon/ribbon.esm.js
index 61eb8dc6c..df91bfe9c 100644
--- a/web_environment_ribbon/static/src/components/environment_ribbon/ribbon.esm.js
+++ b/web_environment_ribbon/static/src/components/environment_ribbon/ribbon.esm.js
@@ -7,7 +7,7 @@ import {registry} from "@web/core/registry";
export class WebEnvironmentRibbon extends Component {
setup() {
this.orm = useService("orm");
- useBus(this.env.bus, "WEB_CLIENT_READY", this.showRibbon.bind(this));
+ useBus(this.env.bus, "WEB_CLIENT_READY", () => this.showRibbon());
}
// Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/
@@ -32,31 +32,30 @@ export class WebEnvironmentRibbon extends Component {
return image.style.color !== "rgb(255, 255, 255)";
}
- showRibbon() {
- const ribbon = $(".test-ribbon");
- const self = this;
- ribbon.hide();
+ async showRibbon() {
+ const ribbon = document.getElementsByClassName("test-ribbon")[0];
+ ribbon.style.display = "none";
// Get ribbon data from backend
- self.orm
- .call("web.environment.ribbon.backend", "get_environment_ribbon")
- .then(function (ribbon_data) {
- // Ribbon name
- if (ribbon_data.name && ribbon_data.name !== "False") {
- ribbon.show();
- ribbon.html(ribbon_data.name);
- }
- // Ribbon color
- if (ribbon_data.color && self.validStrColour(ribbon_data.color)) {
- ribbon.css("color", ribbon_data.color);
- }
- // Ribbon background color
- if (
- ribbon_data.background_color &&
- self.validStrColour(ribbon_data.background_color)
- ) {
- ribbon.css("background-color", ribbon_data.background_color);
- }
- });
+ const ribbon_data = await this.orm.call(
+ "web.environment.ribbon.backend",
+ "get_environment_ribbon"
+ );
+ // Ribbon name
+ if (ribbon_data.name && ribbon_data.name !== "False") {
+ ribbon.style.display = "block";
+ ribbon.innerHTML = ribbon_data.name;
+ }
+ // Ribbon color
+ if (ribbon_data.color && this.validStrColour(ribbon_data.color)) {
+ ribbon.style.color = ribbon_data.color;
+ }
+ // Ribbon background color
+ if (
+ ribbon_data.background_color &&
+ this.validStrColour(ribbon_data.background_color)
+ ) {
+ ribbon.style.backgroundColor = ribbon_data.background_color;
+ }
}
}