diff --git a/addons/web/__manifest__.py b/addons/web/__manifest__.py index 7015f7cebcf..919fda1229a 100644 --- a/addons/web/__manifest__.py +++ b/addons/web/__manifest__.py @@ -124,6 +124,7 @@ This module provides the core of the Odoo Web Client. ], 'web.assets_frontend_minimal': [ 'web/static/src/polyfills/object.js', + 'web/static/src/polyfills/array.js', 'web/static/src/module_loader.js', 'web/static/src/session.js', 'web/static/src/core/browser/cookie.js', diff --git a/addons/web/static/src/polyfills/array.js b/addons/web/static/src/polyfills/array.js new file mode 100644 index 00000000000..cff897c1792 --- /dev/null +++ b/addons/web/static/src/polyfills/array.js @@ -0,0 +1,8 @@ +if (!Array.prototype.at) { + Array.prototype.at = function (index) { + if (index >= 0) { + return this[index]; + } + return this[this.length + index]; + }; +}