Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
2
web_m2x_options/models/__init__.py
Executable file
2
web_m2x_options/models/__init__.py
Executable file
@@ -0,0 +1,2 @@
|
||||
from . import ir_config_parameter
|
||||
from . import ir_http
|
||||
18
web_m2x_options/models/ir_config_parameter.py
Executable file
18
web_m2x_options/models/ir_config_parameter.py
Executable file
@@ -0,0 +1,18 @@
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class IrConfigParameter(models.Model):
|
||||
_inherit = "ir.config_parameter"
|
||||
|
||||
@api.model
|
||||
def get_web_m2x_options(self):
|
||||
opts = [
|
||||
"web_m2x_options.create",
|
||||
"web_m2x_options.create_edit",
|
||||
"web_m2x_options.limit",
|
||||
"web_m2x_options.search_more",
|
||||
"web_m2x_options.field_limit_entries",
|
||||
"web_m2x_options.open",
|
||||
]
|
||||
values = self.sudo().search_read([["key", "in", opts]], ["key", "value"])
|
||||
return {res["key"]: res["value"] for res in values}
|
||||
11
web_m2x_options/models/ir_http.py
Executable file
11
web_m2x_options/models/ir_http.py
Executable file
@@ -0,0 +1,11 @@
|
||||
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({"web_m2x_options": IrConfigSudo.get_web_m2x_options()})
|
||||
return session_info
|
||||
Reference in New Issue
Block a user