diff --git a/product_code_unique/models/__init__.py b/product_code_unique/models/__init__.py index 2c3319d8df1..6340b36bc8a 100644 --- a/product_code_unique/models/__init__.py +++ b/product_code_unique/models/__init__.py @@ -1,4 +1,5 @@ # Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from . import product +from . import product_product +from . import product_template diff --git a/product_code_unique/models/product.py b/product_code_unique/models/product_product.py similarity index 78% rename from product_code_unique/models/product.py rename to product_code_unique/models/product_product.py index 46744403d12..51e508aef24 100644 --- a/product_code_unique/models/product.py +++ b/product_code_unique/models/product_product.py @@ -1,7 +1,7 @@ # Copyright (C) 2018 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models +from odoo import api, models class ProductProduct(models.Model): @@ -14,3 +14,7 @@ class ProductProduct(models.Model): "Internal Reference must be unique across the database!", ) ] + + @api.onchange() + def _onchange_default_code(self): + return diff --git a/product_code_unique/models/product_template.py b/product_code_unique/models/product_template.py new file mode 100644 index 00000000000..7be9d5416f4 --- /dev/null +++ b/product_code_unique/models/product_template.py @@ -0,0 +1,12 @@ +# Copyright 2026 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + @api.onchange() + def _onchange_default_code(self): + return diff --git a/product_code_unique/readme/ROADMAP.md b/product_code_unique/readme/ROADMAP.md deleted file mode 100644 index b06fa45223c..00000000000 --- a/product_code_unique/readme/ROADMAP.md +++ /dev/null @@ -1,4 +0,0 @@ -- Avoid duplicate warnings. Odoo has a warning for duplicate "Internal - Reference" of its own (it doesn't block from saving). Now both - warnings are displayed when trying to save a duplicate "Internal - Reference".