diff --git a/addons/product/i18n/product.pot b/addons/product/i18n/product.pot index 963680d61f1..f0a8e05da9d 100644 --- a/addons/product/i18n/product.pot +++ b/addons/product/i18n/product.pot @@ -2820,6 +2820,14 @@ msgid "" "You cannot move the attribute %s from the product %s to the product %s." msgstr "" +#. module: product +#: code:addons/product/models/product_pricelist.py:0 +#, python-format +msgid "" +"You cannot disable a pricelist rule, please delete it or archive its " +"pricelist instead." +msgstr "" + #. module: product #: code:addons/product/models/product_attribute.py:0 #: code:addons/product/models/product_attribute.py:0 diff --git a/addons/product/models/product_pricelist_item.py b/addons/product/models/product_pricelist_item.py index 8c268a1640f..8c64ba45c70 100644 --- a/addons/product/models/product_pricelist_item.py +++ b/addons/product/models/product_pricelist_item.py @@ -295,6 +295,9 @@ class PricelistItem(models.Model): values.update(dict(categ_id=None)) return super().write(values) + def toggle_active(self): + raise ValidationError(_("You cannot disable a pricelist rule, please delete it or archive its pricelist instead.")) + #=== BUSINESS METHODS ===# def _is_applicable_for(self, product, qty_in_product_uom):