summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/control_panel.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-05-23 15:18:03 +0200
committerqsm-odoo <qsm@odoo.com>2016-05-23 17:08:50 +0200
commitd4f8096790e3a76e3219d37ea17a7154b426d2fe (patch)
treefe0508091613ce801d381958c2390be38a3d9cad /addons/web/static/src/js/control_panel.js
parent865ccfe636f9ce51cde701752e8938a5ecabad25 (diff)
[FIX] web,base: m2o empty name results
M2O use the autocomplete lib to display its content. The problem is that if a result is empty (or only composed of whitespaces), a divider is displayed in the dropdown. Commit 1d9f7d279a74aaf6aaf25f91e2313b23b4122827 was fixing this by only displaying non-empty name results... but it did not work as many models implement the name_search method the wrong way. The new solution is to add a default display for record values which are empty strings, at the right places in the webclient components.
Diffstat (limited to 'addons/web/static/src/js/control_panel.js')
-rw-r--r--addons/web/static/src/js/control_panel.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/control_panel.js b/addons/web/static/src/js/control_panel.js
index 3a233564368..24e94b94fbb 100644
--- a/addons/web/static/src/js/control_panel.js
+++ b/addons/web/static/src/js/control_panel.js
@@ -32,6 +32,7 @@ odoo.define('web.ControlPanel', function (require) {
"use strict";
var core = require('web.core');
+var data = require('web.data');
var Widget = require('web.Widget');
var ControlPanel = Widget.extend({
@@ -190,8 +191,9 @@ var ControlPanel = Widget.extend({
_render_breadcrumbs_li: function (bc, index, length) {
var self = this;
var is_last = (index === length-1);
+ var li_content = _.escape(bc.title.trim()) || data.noDisplayContent;
var $bc = $('<li>')
- .append(is_last ? _.escape(bc.title) : $('<a>').text(bc.title))
+ .append(is_last ? li_content : $('<a>').html(li_content))
.toggleClass('active', is_last);
if (!is_last) {
$bc.click(function () {