[FIX] web: add fallback to Object.hasOwn in patch function
The patch function was changed at commit [1]. This introduced a call to `Object.hasOwn` which is the preferred way to check if an Object has a property as its own. However, after multiple user reports, it seems like a significant amount of user and website visitors still use browsers that do not have Object.hasOwn implemented. This commit adds a polyfill to add Obejct.hasOwn in case it is not found. [1]: https://github.com/odoo/odoo/commit/04fddc19d4aedd8105e0fda5582288c2bb1833fe Fixes https://github.com/odoo/odoo/issues/142022 opw-3824593 Part-of: odoo/odoo#160758
This commit is contained in:
@@ -123,6 +123,7 @@ This module provides the core of the Odoo Web Client.
|
||||
'web/static/src/start.js',
|
||||
],
|
||||
'web.assets_frontend_minimal': [
|
||||
'web/static/src/polyfills/object.js',
|
||||
'web/static/src/module_loader.js',
|
||||
'web/static/src/session.js',
|
||||
'web/static/src/core/browser/cookie.js',
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
if (!Object.hasOwn) {
|
||||
Object.hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
Reference in New Issue
Block a user