Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sehrishnaz/ffb6e1e7645087ee4647fd9fc7681387 to your computer and use it in GitHub Desktop.
Save sehrishnaz/ffb6e1e7645087ee4647fd9fc7681387 to your computer and use it in GitHub Desktop.
Hide or Disable Breadcrumb in Odoo us JavaScript
(function() {
var instance = openerp;
t = instance.web._t;
instance.web.ActionManager.include({
get_title: function() {
var titles = [];
if (this.breadcrumbs.length > 1){
console.log('->'+this.breadcrumbs.length)
var result_model = this.breadcrumbs[0].action['res_model']
if (result_model != 'your.model.goes.here'){
for (var i = 0; i < this.breadcrumbs.length; i += 1) {
var item = this.breadcrumbs[i];
var tit = item.get_title();
if (item.hide_breadcrumb) {
continue;
}
if (!_.isArray(tit)) {
tit = [tit];
}
for (var j = 0; j < tit.length; j += 1) {
var label = _.escape(tit[j]);
if (i === this.breadcrumbs.length - 1 && j === tit.length - 1) {
titles.push(_.str.sprintf('<span class="oe_breadcrumb_item">%s</span>', label));
} else {
titles.push(_.str.sprintf('<a href="#" class="oe_breadcrumb_item" data-id="%s">%s</a>', item.id, label));
}
}
}
return titles.join(' <span class="oe_fade">/</span> ');
}
}
},
});
})();
@sehrishnaz
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment