Skip to content

Instantly share code, notes, and snippets.

@mrvdb
Last active December 28, 2015 10:09
Show Gist options
  • Save mrvdb/7484003 to your computer and use it in GitHub Desktop.
Save mrvdb/7484003 to your computer and use it in GitHub Desktop.
change document title for openerp
// Simple usecase here is I want to override the document title function from chrome.js
// Make sure the code is loaded, i.e. set to module name
openerp.profile_hsd = function(instance) {
// Override the set_title method to our own to have recognizable document titles
// FIXME: this comes *after* it has already been set to OpenERP earlier, perhaps no biggie
instance.web.WebClient.include({
set_title: function(title) {
title = _.str.clean(title);
var sep = _.isEmpty(title) ? '' : ' - ';
document.title = title + sep + 'HSD';
},
});
}
@Capriatto
Copy link

Useful :) Thanks

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