eradicate_quickreate: fix hook

if the record already exists and is False, we shouldn't create a new record
This commit is contained in:
Hpar
2022-10-31 15:44:37 +01:00
committed by GitHub
parent 553f05c58f
commit f1eeaa2e8a

View File

@@ -10,7 +10,7 @@ def web_m2x_options_create(cr, registry):
env = Environment(cr, SUPERUSER_ID, {})
config_parameter = env['ir.config_parameter'].search(
[('key', '=', 'web_m2x_options.create')])
if config_parameter and config_parameter.value != 'False':
if config_parameter:
config_parameter.write({'value': 'False'})
else:
env['ir.config_parameter'].create({