Files
odoo-usability/eradicate_quick_create/hooks.py

16 lines
562 B
Python

# Copyright 2019-2023 Akretion France
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def web_m2x_options_create(env):
config_parameter = env['ir.config_parameter'].search(
[('key', '=', 'web_m2x_options.create')])
if config_parameter and config_parameter.value != 'False':
config_parameter.write({'value': 'False'})
else:
env['ir.config_parameter'].create({
'key': 'web_m2x_options.create',
'value': 'False',
})