diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-12-16 12:20:54 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-12-16 12:20:54 +0100 |
| commit | 265d9e1ef4efebc15d5d04ef412de9f5452296c4 (patch) | |
| tree | 010ad2c4193999d7663cb2b8cfbc282e9a5969a5 /addons/web/static/src/js/core.js | |
| parent | b3a04d317b078a474f8b6df8952cd039beacbde9 (diff) | |
[ADD] translatable name to views
lp bug: https://launchpad.net/bugs/904989 fixed
bzr revid: xmo@openerp.com-20111216112054-xys9q3ap6dcatppr
Diffstat (limited to 'addons/web/static/src/js/core.js')
| -rw-r--r-- | addons/web/static/src/js/core.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 3d66c4f4ccf..12422fb5434 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -254,14 +254,16 @@ openerp.web.Registry = openerp.web.Class.extend( /** @lends openerp.web.Registry * Retrieves the object matching the provided key string. * * @param {String} key the key to fetch the object for + * @param {Boolean} [silent_error=false] returns undefined if the key or object is not found, rather than throwing an exception * @returns {Class} the stored class, to initialize * * @throws {openerp.web.KeyNotFound} if the object was not in the mapping * @throws {openerp.web.ObjectNotFound} if the object path was invalid */ - get_object: function (key) { + get_object: function (key, silent_error) { var path_string = this.map[key]; if (path_string === undefined) { + if (silent_error) { return void 'nooo'; } throw new openerp.web.KeyNotFound(key); } @@ -272,6 +274,7 @@ openerp.web.Registry = openerp.web.Class.extend( /** @lends openerp.web.Registry object_match = object_match[path[i]]; if (object_match === undefined) { + if (silent_error) { return void 'noooooo'; } throw new openerp.web.ObjectNotFound(path_string); } } |
