diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-02-12 16:10:52 +0100 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-02-12 16:16:06 +0100 |
| commit | 83354c2b24bc6c9db1fb63440115d2d4db5bd4ef (patch) | |
| tree | 0337dd42434200cb7279cc678dccd71cda61a17d /addons/web/static/src/js/core/utils.js | |
| parent | dd610140bf272e21a5c3ba45202bcde8e417cfaa (diff) | |
| parent | 7339ae978f5c3d374c43d59e9f75bc6d279d1c96 (diff) | |
[MERGE] mail,web,*: JS mail and services tracebacks
* account,bus, web_editor, website, website_slides, web_tour
This merge fixes most issues where the webclient crashed with
discuss installed in mobile.
These issues occur due to the fact that the chat_manager, now
a service, was loaded after the webclient is instantiated.
The main idea of the fix is to let the webclient register services
that are loaded after its instantiation.
Despite appearances, the desktop mode had also this issue, but
most of the bugs were hidden thanks to the availability of tours
that are loaded after the module mail.
Diffstat (limited to 'addons/web/static/src/js/core/utils.js')
| -rw-r--r-- | addons/web/static/src/js/core/utils.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js index 0b4af722203..1bdd9e70a69 100644 --- a/addons/web/static/src/js/core/utils.js +++ b/addons/web/static/src/js/core/utils.js @@ -301,37 +301,6 @@ var utils = { return fn(mod, Math.floor(x)); }, /** - * Topological sort of nodes - * - * @param {Object} nodes where key is name of node, and value is list of - * names of dependent nodes. - * @param {string[]} nodes[name] list of named dependencies of node having - * 'name' as its name. - * @return {string[]} topological sort of nodes by their names. - * @throws {Error} if there is at least one circular - * dependency between nodes - */ - topologicalSort: function (nodes) { - var sorted = []; - var unresolved = nodes; - while (!_.isEmpty(unresolved)) { - // Get all nodes that have no dependency - var resolvable = _.pick(unresolved, function (dependencies, name) { - return _.isEmpty(_.difference(dependencies, sorted)); - }); - if (_.isEmpty(resolvable)) { - throw new Error("Circular dependency detected"); - } - // Append them to sorted - sorted = _.union(sorted, _.keys(resolvable)); - // Remove these nodes from unresolved - _.each(resolvable, function (dependencies, name) { - unresolved = _.omit(unresolved, name); - }); - } - return sorted; - }, - /** * performs a half up rounding with a fixed amount of decimals, correcting for float loss of precision * See the corresponding float_round() in server/tools/float_utils.py for more info * @param {Number} value the value to be rounded |
