14 lines
480 B
Python
14 lines
480 B
Python
from odoo import models
|
|
|
|
|
|
class IrHttp(models.AbstractModel):
|
|
_inherit = "ir.http"
|
|
|
|
def session_info(self):
|
|
"""Expose the configured max upload size to the web client."""
|
|
info = super().session_info()
|
|
config = self.env["ir.config_parameter"].sudo()
|
|
upload_limit_mb = int(config.get_param("mvd_tcg_base.max_file_upload_size_mb", "256") or 256)
|
|
info["max_file_upload_size"] = max(upload_limit_mb, 1) * 1024 * 1024
|
|
return info
|