mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[UPD] web_dialog_size: reduce rpc call to get config
After installing web_dialog_size and setup its parameter, there's a slight delay where we can see the modal at its normal size and then after a rpc to ir.config_parameter:get_web_dialog_size_config() the modal is maximized. This commit is to set a session value then use it to set initial dialog size upfront without delay.
This commit is contained in:
14
web_dialog_size/models/ir_http.py
Normal file
14
web_dialog_size/models/ir_http.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Copyright 2023 Camptocamp
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class Http(models.AbstractModel):
|
||||
_inherit = "ir.http"
|
||||
|
||||
def session_info(self):
|
||||
IrConfigSudo = self.env["ir.config_parameter"].sudo()
|
||||
session_info = super().session_info()
|
||||
session_info.update(IrConfigSudo.get_web_dialog_size_config())
|
||||
return session_info
|
||||
Reference in New Issue
Block a user