Files
web/web_m2x_options/models/ir_config_parameter.py
Carlos Roca 7fb6885241 [IMP] web_m2x_options: Efficiency
Improved the efficiency of code: With this improvement we achieve to just do an rpc call when the js file is called instead of do the call for each field.
2022-03-18 17:28:38 +07:00

20 lines
540 B
Python

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.m2o_dialog",
]
return {
res["key"]: res["value"]
for res in self.sudo().search_read([["key", "in", opts]], ["key", "value"])
}