From 12f246356751ad6aa0fea2877a67b9b1d4dfe255 Mon Sep 17 00:00:00 2001 From: Ivan Kropotkin Date: Fri, 15 Dec 2023 14:00:40 +0100 Subject: [PATCH] :arrow_up: ir_rule_protected: port to v17 --- ir_rule_protected/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ir_rule_protected/models.py b/ir_rule_protected/models.py index 87213c79..14b832c7 100644 --- a/ir_rule_protected/models.py +++ b/ir_rule_protected/models.py @@ -16,7 +16,7 @@ def check_restricted(self): return for r in self: if r.protected: - raise exceptions.Warning( + raise exceptions.UserError( _("The Rule is protected. You don't have access for this operation") ) @@ -35,5 +35,5 @@ class Module(models.Model): def button_uninstall(self): for r in self: if r.name == MODULE_NAME and self.env.uid != SUPERUSER_ID: - raise exceptions.Warning(_("Only admin can uninstall the module")) + raise exceptions.UserError(_("Only admin can uninstall the module")) return super(Module, self).button_uninstall()