Before the websocket were introduced, the last notification id was persisted in the local storage in order to use it even after a page reload. The last notification id is now stored on the `SharedWorker` which means this information is lost if the last opened tab is reloaded. This commit fixes this issue by storing this information by the mean of the localStorage. Since the localStorage is not accessible from the worker global scope, the bus service will store this information and relay it to the worker when starting. The worker will now wait to receive the last notification id before subscribing. closes odoo/odoo#99621 Related: odoo/enterprise#31124 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
19 lines
593 B
Python
19 lines
593 B
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models
|
|
from odoo.http import request
|
|
|
|
|
|
class IrHttp(models.AbstractModel):
|
|
_inherit = 'ir.http'
|
|
|
|
def session_info(self):
|
|
result = super().session_info()
|
|
result['dbuuid'] = request.env['ir.config_parameter'].sudo().get_param('database.uuid')
|
|
return result
|
|
|
|
def get_frontend_session_info(self):
|
|
result = super().get_frontend_session_info()
|
|
result['dbuuid'] = request.env['ir.config_parameter'].sudo().get_param('database.uuid')
|
|
return result
|