diff options
| author | Fabien Meghazi <fme@odoo.com> | 2017-02-28 12:20:36 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@odoo.com> | 2017-02-28 13:11:24 +0100 |
| commit | 3c8a2bcaf0710e9e12c82194c36180fb207d97ee (patch) | |
| tree | 25d3ac02c60f45f287452bc509699e48ff22a0ee /addons/web | |
| parent | ebacd0d77b74997b2a273e66ae085a4fd12a38ae (diff) | |
[FIX] qweb2.js: fix erratic object type detection in foreach (Fixes #15655)
Could not add a test as the qweb js testsuite is broken and it's xml
test files have been modified in order to test qweb.py specific cases.
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/static/lib/qweb/qweb2.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index d5449dae6d9..1ea73e6278e 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -153,14 +153,15 @@ var QWeb2 = { foreach: function(context, enu, as, old_dict, callback) { if (enu != null) { var index, jlen, cur; - var size, new_dict = this.extend({}, old_dict); + var new_dict = this.extend({}, old_dict); new_dict[as + "_all"] = enu; var as_value = as + "_value", as_index = as + "_index", as_first = as + "_first", as_last = as + "_last", as_parity = as + "_parity"; - if (size = enu.length) { + if (enu instanceof Array) { + var size = enu.length; new_dict[as + "_size"] = size; for (index = 0, jlen = enu.length; index < jlen; index++) { cur = enu[index]; |
