From f1eeaa2e8a4ceeda2ae24fa1131c51f82c0b554c Mon Sep 17 00:00:00 2001 From: Hpar Date: Mon, 31 Oct 2022 15:44:37 +0100 Subject: [PATCH] eradicate_quickreate: fix hook if the record already exists and is False, we shouldn't create a new record --- eradicate_quick_create/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eradicate_quick_create/hooks.py b/eradicate_quick_create/hooks.py index 3181b65..3f8667e 100644 --- a/eradicate_quick_create/hooks.py +++ b/eradicate_quick_create/hooks.py @@ -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({