From 0785c6982d7fbfcd3f8c2d202870b5da91e69d30 Mon Sep 17 00:00:00 2001 From: momegahed Date: Mon, 12 Jun 2023 17:16:21 +0000 Subject: [PATCH] [FIX] UserError.name still used although it was removed Bug: the property name was removed in https://github.com/odoo/odoo/commit/d200dcfb2c912353d404312b9d9484846868cf96 similar to: https://github.com/odoo/enterprise/pull/42033 https://github.com/odoo/enterprise/pull/40754 opw-3368194 closes odoo/odoo#126070 X-original-commit: 6e6b067b5109327489dccdcc1f5e5405994f98d0 Related: odoo/enterprise#43002 Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) --- addons/l10n_ch/tests/test_l10n_ch_qr_print.py | 2 +- addons/microsoft_outlook/controllers/main.py | 2 +- addons/portal/controllers/portal.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/l10n_ch/tests/test_l10n_ch_qr_print.py b/addons/l10n_ch/tests/test_l10n_ch_qr_print.py index 19cee822985..49369776f50 100644 --- a/addons/l10n_ch/tests/test_l10n_ch_qr_print.py +++ b/addons/l10n_ch/tests/test_l10n_ch_qr_print.py @@ -56,7 +56,7 @@ class QRPrintTest(AccountTestInvoicingCommon): invoice.action_invoice_sent() return True except UserError as e: - _logger.warning(e.name) + _logger.warning(str(e)) return False def test_print_qr(self): diff --git a/addons/microsoft_outlook/controllers/main.py b/addons/microsoft_outlook/controllers/main.py index a4fc8ac93e7..fd1bb08465e 100644 --- a/addons/microsoft_outlook/controllers/main.py +++ b/addons/microsoft_outlook/controllers/main.py @@ -62,7 +62,7 @@ class MicrosoftOutlookController(http.Controller): refresh_token, access_token, expiration = record._fetch_outlook_refresh_token(code) except UserError as e: return request.render('microsoft_outlook.microsoft_outlook_oauth_error', { - 'error': str(e.name), + 'error': str(e), 'model_name': model_name, 'rec_id': rec_id, }) diff --git a/addons/portal/controllers/portal.py b/addons/portal/controllers/portal.py index 920f6717f18..d36353deeea 100644 --- a/addons/portal/controllers/portal.py +++ b/addons/portal/controllers/portal.py @@ -260,7 +260,7 @@ class CustomerPortal(Controller): msg = _('The old password you provided is incorrect, your password was not changed.') return {'errors': {'password': {'old': msg}}} except UserError as e: - return {'errors': {'password': e.name}} + return {'errors': {'password': str(e)}} # update session token so the user does not get logged out (cache cleared by passwd change) new_token = request.env.user._compute_session_token(request.session.sid)