summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2019-12-04 07:27:41 +0000
committerNicolas Martinelli <nim@odoo.com>2019-12-04 11:59:12 +0000
commit99a25142e448cfa16f8e85629462a547d531a095 (patch)
tree9cbf4506d4f299e79cee781e0cb2d0a429752683
parent637c0fbc1080f33903cee7369692b4a5ab11d819 (diff)
[FIX] web: support title field in ribbon
The `text` attribute is not translatable, so we support the `title` attribute which is. Fixes #38568 opw-2148416 X-original-commit: 21203ec63db6702529a791f5abab317c6d4fb8af
-rw-r--r--addons/web/static/src/js/widgets/ribbon.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/widgets/ribbon.js b/addons/web/static/src/js/widgets/ribbon.js
index 404ae256487..37ebdbf75c1 100644
--- a/addons/web/static/src/js/widgets/ribbon.js
+++ b/addons/web/static/src/js/widgets/ribbon.js
@@ -4,7 +4,7 @@ odoo.define('web.ribbon', function (require) {
/**
* This widget adds a ribbon on the top right side of the form
*
- * - You can specify the text with the text attribute.
+ * - You can specify the text with the title attribute.
* - You can specify a background color for the ribbon with the bg_color attribute
* using bootstrap classes :
* (bg-primary, bg-secondary, bg-success, bg-danger, bg-warning, bg-info,
@@ -23,7 +23,7 @@ odoo.define('web.ribbon', function (require) {
init: function (parent, data, options) {
this._super.apply(this, arguments);
- this.text = options.attrs.text;
+ this.text = options.attrs.title || options.attrs.text;
this.bgColor = options.attrs.bg_color;
}