Skip to content
Snippets Groups Projects
Commit 29e844a8 authored by Julien Castiaux's avatar Julien Castiaux
Browse files

[FIX] base: fix exception retro-compatibility-aid


Restore the old signature of except_orm.

opw-2354525
opw-2355980

closes odoo/odoo#59443

Signed-off-by: default avatarToufik Benjaa (tbe) <tbe@odoo.com>
parent e967cd67
Branches
Tags
No related merge requests found
......@@ -125,9 +125,9 @@ class ValidationError(UserError):
# Warning.
class except_orm(UserError):
def __init__(self, *args, **kwargs):
def __init__(self, name, value=None):
warnings.warn("except_orm is a deprecated alias to UserError.", DeprecationWarning)
super().__init__(*args, **kwargs)
super().__init__(f"{name}: {value}")
class Warning(UserError):
def __init__(self, *args, **kwargs):
......
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from ..exceptions import UserError
from ..exceptions import except_orm
from ..models import Model, TransientModel, AbstractModel
# Deprecated, kept for backward compatibility.
except_osv = UserError
except_osv = except_orm
# Deprecated, kept for backward compatibility.
osv = Model
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment