diff options
| author | Thibault Delavallée <tde@odoo.com> | 2017-10-26 17:35:59 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2017-10-27 10:36:11 +0200 |
| commit | c59597f5e034c4a979953b05b4ee06ae2dfd17fe (patch) | |
| tree | 9e1da65f3284544165ae95559cd93d0500f483f8 /addons/account_payment/controllers/payment.py | |
| parent | b72b10c1914a6a756e7eff53cd584cce706efb6e (diff) | |
[FIX] (account, sale)_payment: fix s2s on not existing document
Returned error was not correct as just browsing an ID that
does not exist is not sufficient. We should use exists.
Diffstat (limited to 'addons/account_payment/controllers/payment.py')
| -rw-r--r-- | addons/account_payment/controllers/payment.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account_payment/controllers/payment.py b/addons/account_payment/controllers/payment.py index 7427d768dad..80924b910bd 100644 --- a/addons/account_payment/controllers/payment.py +++ b/addons/account_payment/controllers/payment.py @@ -64,7 +64,7 @@ class PaymentPortal(http.Controller): if access_token: params['access_token'] = access_token - invoice_sudo = request.env['account.invoice'].sudo().browse(invoice_id) + invoice_sudo = request.env['account.invoice'].sudo().browse(invoice_id).exists() if not invoice_sudo: params['error'] = 'pay_invoice_invalid_doc' return request.redirect(_build_url_w_params(error_url, params)) |
