diff options
| author | jev-odoo <jev@odoo.com> | 2020-05-20 10:25:43 +0000 |
|---|---|---|
| committer | jev-odoo <jev@odoo.com> | 2020-05-26 08:56:03 +0000 |
| commit | 2ef534a6d529a3c27a938f44ddf903a40ffc10fa (patch) | |
| tree | 08a4aa9385eb059e107969b8a6018a9c5fca9780 /addons/payment | |
| parent | 4dbab5a70ba02b145396ecc1326ec64cb45c481c (diff) | |
[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>
Diffstat (limited to 'addons/payment')
| -rw-r--r-- | addons/payment/i18n/payment.pot | 5 | ||||
| -rw-r--r-- | addons/payment/wizards/payment_link_wizard.py | 1 | ||||
| -rw-r--r-- | addons/payment/wizards/payment_link_wizard_views.xml | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/addons/payment/i18n/payment.pot b/addons/payment/i18n/payment.pot index dbe1b5a5813..85037e2177e 100644 --- a/addons/payment/i18n/payment.pot +++ b/addons/payment/i18n/payment.pot @@ -1126,6 +1126,11 @@ 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 msgid "" diff --git a/addons/payment/wizards/payment_link_wizard.py b/addons/payment/wizards/payment_link_wizard.py index dd75560dd57..57b3ec1282d 100644 --- a/addons/payment/wizards/payment_link_wizard.py +++ b/addons/payment/wizards/payment_link_wizard.py @@ -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') diff --git a/addons/payment/wizards/payment_link_wizard_views.xml b/addons/payment/wizards/payment_link_wizard_views.xml index cd284f0f20f..3c02dd2f24d 100644 --- a/addons/payment/wizards/payment_link_wizard_views.xml +++ b/addons/payment/wizards/payment_link_wizard_views.xml @@ -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> |
