Browse Source

🚑 fix race condition with mail module initialization

Because mail module in Odoo 11 version doesn't allow to extend, we repeat initialization.
That may conflict with original initialization. In order to solve that, we wait for original initialization and only then start the process

patch from @yelizariev
pull/324/head
Denis Mudarisov 3 years ago
parent
commit
eaf2fb3c88
No known key found for this signature in database GPG Key ID: B9AD74DAFB7B53DA
  1. 2
      mail_base/__manifest__.py
  2. 5
      mail_base/doc/changelog.rst
  3. 8
      mail_base/static/lib/base.js

2
mail_base/__manifest__.py

@ -7,7 +7,7 @@
"summary": """Makes Mail extendable""",
"category": "Discuss",
"images": ["images/mail_base_image.png"],
"version": "11.0.1.1.1",
"version": "11.0.1.1.2",
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@itpp.dev",
"website": "https://it-projects.info",

5
mail_base/doc/changelog.rst

@ -1,3 +1,8 @@
`1.1.2`
-------
**FIX**: random initialization errors
`1.1.1`
-------

8
mail_base/static/lib/base.js

@ -123,6 +123,8 @@ ChatAction.include({
}
});
function init_chat_manager(){
chat_manager.notify_incoming_message = function (msg, options) {
if (bus.is_odoo_focused() && options.is_displayed) {
// no need to notify
@ -1409,11 +1411,17 @@ chat_manager.search_partner = function (search_val, limit) {
});
}
}; // init_chat_manager
chat_manager.is_ready = chat_manager.is_ready.then(function(){
init_chat_manager();
chat_manager.start();
bus.off('notification');
bus.on('notification', null, function () {
chat_manager.on_notification.apply(chat_manager, arguments);
});
});
return {
ODOOBOT_ID: ODOOBOT_ID,

Loading…
Cancel
Save