From 1f3d4579de28d8a61ad6835dac47d9781df8e7d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernanda=20Hern=C3=A1ndez?= Date: Wed, 12 Jan 2022 22:24:31 +0000 Subject: [PATCH] [FIX] mail_tracking: change order of inheritance and use return Currently when a invoice view is reload in browser or through native redirections, an error is raised: ``` Traceback: TypeError: Cannot read properties of undefined (reading 'id') at Function.convertData [as _super] (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:5768:118) at Function.convertData (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:6651:335) at Function.Class. (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:6478:107) at Function.convertData (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:7779:403) at Function.Class. (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:6478:107) at Function.convertData (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:7818:353) at Function.Class. (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:6478:107) at Function.convertData (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:12197:435) at Function.Class. (https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:6478:107) at https://t50084-053-islamicrelief140.dev.irc.deployv.com/web/content/1819726-9a8777a/web.assets_backend.js:5790:359 ``` That is because an inheritance wrong, which breaks the flow of start of model `messaging` and causes that messages execute before the init of var `messaging`. --- mail_tracking/static/src/js/discuss/discuss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_tracking/static/src/js/discuss/discuss.js b/mail_tracking/static/src/js/discuss/discuss.js index b72915f..8ef924c 100644 --- a/mail_tracking/static/src/js/discuss/discuss.js +++ b/mail_tracking/static/src/js/discuss/discuss.js @@ -14,7 +14,6 @@ odoo.define("mail_tracking/static/src/js/discuss/discuss.js", function (require) "mail/static/src/models/messaging_initializer/messaging_initializer.js", { async start() { - this._super(...arguments); this.messaging.update({ failedmsg: [ [ @@ -28,6 +27,7 @@ odoo.define("mail_tracking/static/src/js/discuss/discuss.js", function (require) ], ], }); + return this._super(...arguments); }, async _init({ channel_slots,