[IMP] web_widget_open_tab: keep breadcrumb

pull/1524/head
Adrià Gil Sorribes 2020-01-08 16:32:25 +01:00 committed by Enric Tobella
parent cb4fa9d6cd
commit 6829873838
1 changed files with 4 additions and 5 deletions

View File

@ -14,12 +14,9 @@ odoo.define('web_widget_open_tab.FieldOpen', function(require) {
isSet: function () { isSet: function () {
return true; return true;
}, },
_getReference: function () {
return 'model=' + this.model + '&id=' + this.res_id;
},
_renderReadonly: function () { _renderReadonly: function () {
var $content = $( var $content = $(
'<a href="#' + this._getReference() + '">' '<a href="#">'
).addClass('fa fa-eye'); ).addClass('fa fa-eye');
this.$el.append($content) this.$el.append($content)
}, },
@ -28,7 +25,9 @@ odoo.define('web_widget_open_tab.FieldOpen', function(require) {
ev.stopPropagation(); ev.stopPropagation();
var element = $(ev.currentTarget).find('a'); var element = $(ev.currentTarget).find('a');
if (element != null && element[0].href != null) { if (element != null && element[0].href != null) {
window.open(element[0].href); var url = new URL(window.location.href);
var href = url.hash.replace("list", "form") + '&id=' + this.res_id;
window.open(href);
} }
}, },
}); });