diff --git a/addons/product/i18n/product.pot b/addons/product/i18n/product.pot index ba1b5a87638..c46b498d459 100644 --- a/addons/product/i18n/product.pot +++ b/addons/product/i18n/product.pot @@ -2549,6 +2549,13 @@ msgid "" "unit of measure of the product otherwise." msgstr "" +#. module: product +#. odoo-python +#: code:addons/product/models/product_pricelist_item.py:0 +#, python-format +msgid "The rounding method must be strictly positive." +msgstr "" + #. module: product #: model:ir.model.fields,help:product.field_product_product__lst_price msgid "" diff --git a/addons/product/models/product_pricelist_item.py b/addons/product/models/product_pricelist_item.py index 61e59aba56a..571f44c957e 100644 --- a/addons/product/models/product_pricelist_item.py +++ b/addons/product/models/product_pricelist_item.py @@ -262,6 +262,11 @@ class PricelistItem(models.Model): template_rules.update({'applied_on': '1_product'}) (self-variants_rules-template_rules).update({'applied_on': '3_global'}) + @api.onchange('price_round') + def _onchange_price_round(self): + if any(item.price_round and item.price_round < 0.0 for item in self): + raise ValidationError(_("The rounding method must be strictly positive.")) + #=== CRUD METHODS ===# @api.model_create_multi