[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) <nim@odoo.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user