diff --git a/addons/point_of_sale/models/pos_category.py b/addons/point_of_sale/models/pos_category.py index 2f2ea7bb94e..1d986867919 100644 --- a/addons/point_of_sale/models/pos_category.py +++ b/addons/point_of_sale/models/pos_category.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError class PosCategory(models.Model): @@ -11,7 +12,7 @@ class PosCategory(models.Model): @api.constrains('parent_id') def _check_category_recursion(self): if not self._check_recursion(): - raise ValueError(_('Error ! You cannot create recursive categories.')) + raise ValidationError(_('Error ! You cannot create recursive categories.')) name = fields.Char(string='Category Name', required=True, translate=True) parent_id = fields.Many2one('pos.category', string='Parent Category', index=True)