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
4 years ago
No known key found for this signature in database
GPG Key ID: B9AD74DAFB7B53DA
3 changed files with
14 additions and
1 deletions
mail_base/__manifest__.py
mail_base/doc/changelog.rst
mail_base/static/lib/base.js
@ -7,7 +7,7 @@
" summary " : """ Makes Mail extendable """ ,
" summary " : """ Makes Mail extendable """ ,
" category " : " Discuss " ,
" category " : " Discuss " ,
" images " : [ " images/mail_base_image.png " ] ,
" images " : [ " images/mail_base_image.png " ] ,
" version " : " 11.0.1.1.1 " ,
" version " : " 11.0.1.1.2 " ,
" author " : " IT-Projects LLC, Pavel Romanchenko " ,
" author " : " IT-Projects LLC, Pavel Romanchenko " ,
" support " : " apps@itpp.dev " ,
" support " : " apps@itpp.dev " ,
" website " : " https://it-projects.info " ,
" website " : " https://it-projects.info " ,
@ -1,3 +1,8 @@
`1.1.2`
-------
**FIX** : random initialization errors
`1.1.1`
`1.1.1`
-------
-------
@ -123,6 +123,8 @@ ChatAction.include({
}
}
} ) ;
} ) ;
function init_chat_manager ( ) {
chat_manager . notify_incoming_message = function ( msg , options ) {
chat_manager . notify_incoming_message = function ( msg , options ) {
if ( bus . is_odoo_focused ( ) && options . is_displayed ) {
if ( bus . is_odoo_focused ( ) && options . is_displayed ) {
// no need to notify
// 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 ( ) ;
chat_manager . start ( ) ;
bus . off ( 'notification' ) ;
bus . off ( 'notification' ) ;
bus . on ( 'notification' , null , function ( ) {
bus . on ( 'notification' , null , function ( ) {
chat_manager . on_notification . apply ( chat_manager , arguments ) ;
chat_manager . on_notification . apply ( chat_manager , arguments ) ;
} ) ;
} ) ;
} ) ;
return {
return {
ODOOBOT_ID : ODOOBOT_ID ,
ODOOBOT_ID : ODOOBOT_ID ,