From c9d98ec511530c317240563f38d75ea7a7fe3a9c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 2 May 2019 13:04:51 +0000 Subject: [PATCH] [FIX] payment_authorize: missing fields - Activate Invoice Online Payment - Set Authorize to pay through Odoo (S2S) - Create a new customer (do not give portal access) - Create invoice -> send to them - Open invoice in incognito mode - Try to pay invoice online with Authorize An error is raised: The transaction cannot be processed because some contact details are missing or invalid: City, Country. Please sign in to complete your profile.If you don't have any account, please ask your salesperson to update your profile. The error is quite confusing, and the user is missing the main point: he needs to sign in. There is no reason to display the fact that contact details are missing for a public user, so this part is now shown only if the user is logged in. opw-1981003 closes odoo/odoo#33116 Signed-off-by: Nicolas Martinelli (nim) --- addons/payment_authorize/controllers/main.py | 8 ++++---- addons/payment_authorize/i18n/payment_authorize.pot | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/addons/payment_authorize/controllers/main.py b/addons/payment_authorize/controllers/main.py index 70d641564a6..cf6877218db 100644 --- a/addons/payment_authorize/controllers/main.py +++ b/addons/payment_authorize/controllers/main.py @@ -55,14 +55,14 @@ class AuthorizeController(http.Controller): except ValidationError as e: message = e.args[0] if isinstance(message, dict) and 'missing_fields' in message: - msg = _("The transaction cannot be processed because some contact details are missing or invalid: ") - message = msg + ', '.join(message['missing_fields']) + '. ' if request.env.user._is_public(): - message += _("Please sign in to complete your profile.") + message = _("Please sign in to complete the payment.") # update message if portal mode = b2b if request.env['ir.config_parameter'].sudo().get_param('auth_signup.allow_uninvited', 'False').lower() == 'false': - message += _("If you don't have any account, please ask your salesperson to update your profile. ") + message += _(" If you don't have any account, ask your salesperson to grant you a portal access. ") else: + msg = _("The transaction cannot be processed because some contact details are missing or invalid: ") + message = msg + ', '.join(message['missing_fields']) + '. ' message += _("Please complete your profile. ") return { diff --git a/addons/payment_authorize/i18n/payment_authorize.pot b/addons/payment_authorize/i18n/payment_authorize.pot index fbb5bde0a7f..b38807a0d0c 100644 --- a/addons/payment_authorize/i18n/payment_authorize.pot +++ b/addons/payment_authorize/i18n/payment_authorize.pot @@ -15,6 +15,12 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: payment_authorize +#: code:addons/payment_authorize/controllers/main.py:62 +#, python-format +msgid " If you don't have any account, ask your salesperson to grant you a portal access. " +msgstr "" + #. module: payment_authorize #: model:ir.model.fields,field_description:payment_authorize.field_payment_acquirer__authorize_login msgid "API Login Id" @@ -132,7 +138,7 @@ msgstr "" #. module: payment_authorize #: code:addons/payment_authorize/controllers/main.py:61 #, python-format -msgid "Please sign in to complete your profile." +msgid "Please sign in to complete the payment." msgstr "" #. module: payment_authorize