diff options
| author | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-06-10 09:29:11 +0000 |
|---|---|---|
| committer | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-06-10 11:57:54 +0000 |
| commit | a758f8f307fe74af93631b77f498db43a845c526 (patch) | |
| tree | 7a46ebe8acff9482adf2150227cb5f9b67a381dc /addons/web/static/src/js/core | |
| parent | 4f825e437ad805c6ec77155b81c12a08fd877953 (diff) | |
[FIX] web: don't forget initial registry entries
The entries comming from the optional parameter 'mapping' passed at the
instantiation of a registry were never considered when returning the
registry keys or entries. This is no longer the case.
closes odoo/odoo#52768
X-original-commit: e094ddd0ffaf3357e64ca5941ffc2e0454c24ab7
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/core')
| -rw-r--r-- | addons/web/static/src/js/core/registry.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/addons/web/static/src/js/core/registry.js b/addons/web/static/src/js/core/registry.js index cf898c647ca..6089ccc827e 100644 --- a/addons/web/static/src/js/core/registry.js +++ b/addons/web/static/src/js/core/registry.js @@ -68,7 +68,12 @@ var Registry = Class.extend({ * @returns {Object} */ entries: function () { - return Object.create(this.map); + var entries = {}; + var keys = this.keys(); + for (var i = 0; i < keys.length; i++) { + entries[keys[i]] = this.map[keys[i]]; + } + return entries; }, /** * Returns the value associated to the given key. @@ -105,7 +110,11 @@ var Registry = Class.extend({ keys: function () { var self = this; if (!this._sortedKeys) { - this._sortedKeys = _.sortBy(Object.keys(this.map), function (key) { + var keys = []; + for (var key in this.map) { + keys.push(key); + } + this._sortedKeys = _.sortBy(keys, function (key) { return self._scoreMapping[key] || 0; }); } |
