From 0cdf231e5a751a106d26fc2ba992a8d10b773cdf Mon Sep 17 00:00:00 2001 From: Gil Arasa Verge Date: Sat, 2 Nov 2024 13:48:58 +0100 Subject: [PATCH] [FIX] product_variant_default_code ir.config_parameter --- product_variant_default_code/models/product.py | 4 +++- .../tests/test_variant_default_code.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/product_variant_default_code/models/product.py b/product_variant_default_code/models/product.py index 110b25699..698b0a823 100644 --- a/product_variant_default_code/models/product.py +++ b/product_variant_default_code/models/product.py @@ -186,7 +186,9 @@ def _guess_main_lang(self): ) def _compute_default_code(self): super()._compute_default_code() - if self.env["ir.config_parameter"].get_param("prefix_as_default_code"): + if self.env["ir.config_parameter"].get_param( + "product_variant_default_code.prefix_as_default_code" + ): unique_variants = self.filtered( lambda template: len(template.product_variant_ids) == 1 ) diff --git a/product_variant_default_code/tests/test_variant_default_code.py b/product_variant_default_code/tests/test_variant_default_code.py index 2e243f452..962f7e346 100644 --- a/product_variant_default_code/tests/test_variant_default_code.py +++ b/product_variant_default_code/tests/test_variant_default_code.py @@ -229,7 +229,9 @@ def test_10_code_change_propagation_archived_variant(self): def test_11_prefix_code_as_default_code_by_default(self): self.assertFalse(self.template1.default_code) - self.env["ir.config_parameter"].set_param("prefix_as_default_code", True) + self.env["ir.config_parameter"].set_param( + "product_variant_default_code.prefix_as_default_code", True + ) self.template1.code_prefix = "prefix_code" self.assertTrue(self.template1.default_code, self.template1.code_prefix)