diff --git a/addons/base/__openerp__.py b/addons/base/__openerp__.py index c8c80cd2e3a..b93e4036f8e 100644 --- a/addons/base/__openerp__.py +++ b/addons/base/__openerp__.py @@ -18,17 +18,17 @@ "static/lib/underscore/underscore.js", "static/lib/underscore/underscore.string.js", "static/src/js/boot.js", + "static/src/js/core.js", + "static/src/js/dates.js", "static/src/js/chrome.js", - "static/src/js/controller.js", "static/src/js/views.js", "static/src/js/data.js", - "static/src/js/dates.js", + "static/src/js/data_export.js", "static/src/js/form.js", "static/src/js/list.js", "static/src/js/list-editable.js", "static/src/js/search.js", "static/src/js/view_tree.js", - "static/src/js/data_export.js", ], 'css' : [ "static/lib/jquery.superfish/css/superfish.css", diff --git a/addons/base/static/src/js/boot.js b/addons/base/static/src/js/boot.js index 5f86a73ed5e..c16f2d261f5 100644 --- a/addons/base/static/src/js/boot.js +++ b/addons/base/static/src/js/boot.js @@ -58,7 +58,7 @@ //--------------------------------------------------------- openerp.base = function(instance) { - openerp.base.controller(instance); + openerp.base.core(instance); openerp.base.dates(instance); openerp.base.chrome(instance); openerp.base.data(instance); diff --git a/addons/base/static/src/js/chrome.js b/addons/base/static/src/js/chrome.js index 41a17d37d94..ed84c32071b 100644 --- a/addons/base/static/src/js/chrome.js +++ b/addons/base/static/src/js/chrome.js @@ -4,139 +4,6 @@ openerp.base.chrome = function(openerp) { -/** - * Base error for lookup failure - * - * @class - */ -openerp.base.NotFound = openerp.base.Class.extend( /** @lends openerp.base.NotFound# */ { -}); -openerp.base.KeyNotFound = openerp.base.NotFound.extend( /** @lends openerp.base.KeyNotFound# */ { - /** - * Thrown when a key could not be found in a mapping - * - * @constructs - * @extends openerp.base.NotFound - * @param {String} key the key which could not be found - */ - init: function (key) { - this.key = key; - }, - toString: function () { - return "The key " + this.key + " was not found"; - } -}); -openerp.base.ObjectNotFound = openerp.base.NotFound.extend( /** @lends openerp.base.ObjectNotFound# */ { - /** - * Thrown when an object path does not designate a valid class or object - * in the openerp hierarchy. - * - * @constructs - * @extends openerp.base.NotFound - * @param {String} path the invalid object path - */ - init: function (path) { - this.path = path; - }, - toString: function () { - return "Could not find any object of path " + this.path; - } -}); -openerp.base.Registry = openerp.base.Class.extend( /** @lends openerp.base.Registry# */ { - /** - * Stores a mapping of arbitrary key (strings) to object paths (as strings - * as well). - * - * Resolves those paths at query time in order to always fetch the correct - * object, even if those objects have been overloaded/replaced after the - * registry was created. - * - * An object path is simply a dotted name from the openerp root to the - * object pointed to (e.g. ``"openerp.base.Session"`` for an OpenERP - * session object). - * - * @constructs - * @param {Object} mapping a mapping of keys to object-paths - */ - init: function (mapping) { - this.map = mapping || {}; - }, - /** - * Retrieves the object matching the provided key string. - * - * @param {String} key the key to fetch the object for - * @returns {Class} the stored class, to initialize - * - * @throws {openerp.base.KeyNotFound} if the object was not in the mapping - * @throws {openerp.base.ObjectNotFound} if the object path was invalid - */ - get_object: function (key) { - var path_string = this.map[key]; - if (path_string === undefined) { - throw new openerp.base.KeyNotFound(key); - } - - var object_match = openerp; - var path = path_string.split('.'); - // ignore first section - for(var i=1; i