From 71cc5c371b0202c048a799673907bcb33c578823 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 133445edc..e36873f20 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 3b7c21f23..f764a2ad0 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)