[FIX] payment: Add email warning when generating payment link
As some payment acquirers require the email to be set, a warning is shown when generating a payment link if the partner does not have an email. OPW-2254011 closes odoo/odoo#51857 X-original-commit: 6f61e89ab9b947ca54cfd8dbd5470083a625d24e Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
@@ -1125,6 +1125,11 @@ msgstr ""
|
||||
msgid "Never"
|
||||
msgstr ""
|
||||
|
||||
#. module: payment
|
||||
#: model_terms:ir.ui.view,arch_db:payment.payment_link_wizard_view_form
|
||||
msgid "This partner has no email, which may cause issues with some payment acquirers. Setting an email for this partner is advised."
|
||||
msgstr ""
|
||||
|
||||
#. module: payment
|
||||
#: code:addons/payment/wizards/payment_acquirer_onboarding_wizard.py:0
|
||||
#, python-format
|
||||
|
||||
@@ -38,6 +38,7 @@ class PaymentLinkWizard(models.TransientModel):
|
||||
amount_max = fields.Monetary(currency_field='currency_id')
|
||||
currency_id = fields.Many2one('res.currency')
|
||||
partner_id = fields.Many2one('res.partner')
|
||||
partner_email = fields.Char(related='partner_id.email')
|
||||
link = fields.Char(string='Payment Link', compute='_compute_values')
|
||||
description = fields.Char('Payment Ref')
|
||||
access_token = fields.Char(compute='_compute_values')
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<field name="res_id" invisible="1"/>
|
||||
<field name="res_model" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="partner_email" invisible="1"/>
|
||||
<field name="amount_max" invisible="1"/>
|
||||
<field name="description"/>
|
||||
<field name="amount"/>
|
||||
@@ -20,6 +21,9 @@
|
||||
<group>
|
||||
<field name="link" readonly="1" widget="CopyClipboardChar"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('partner_email', '!=', False)]}">
|
||||
<p class="alert alert-warning font-weight-bold" role="alert">This partner has no email, which may cause issues with some payment acquirers. Setting an email for this partner is advised.</p>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Close" class="btn-primary" special="cancel"/>
|
||||
</footer>
|
||||
|
||||
Reference in New Issue
Block a user