diff options
| author | Nans Lefebvre <len@odoo.com> | 2019-03-13 09:41:17 +0000 |
|---|---|---|
| committer | Nans Lefebvre <len@odoo.com> | 2019-03-15 14:56:19 +0000 |
| commit | fc1389f8d881adfb94ea1b784fb7104b9eee5d2d (patch) | |
| tree | fc615ff4140f2626205ba4d415db3227d27f2e77 | |
| parent | d7ca0357f39f0c33ced2ed61374f863b1c37d207 (diff) | |
[FIX] payment: provide missing return_url in values
Render from payment//payment_acquirer.py promises:
All templates will receive:
'feedback_url', 'return_url', 'cancel_url', 'error_url'
However they are all in -> FIXME.
After 6 years in FIXME, this promise is still a lie.
It is unfortunate since the Adyen payment provider requires 'return_url' to work.
Before, this function was called by _get_shop_payment_values,
which provided a value for it.
We copy the value that was given there directly as a default in render,
so that it doesn't crash no matter what method calls it.
opw 1928918
opw 1944142
closes odoo/odoo#31814
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
| -rw-r--r-- | addons/payment/models/payment_acquirer.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index bcfcb2025bf..0413c45b9eb 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -356,6 +356,7 @@ class PaymentAcquirer(models.Model): if values is None: values = {} + values.setdefault('return_url', '/payment/process') # reference and amount values.setdefault('reference', reference) amount = float_round(amount, 2) @@ -447,7 +448,6 @@ class PaymentAcquirer(models.Model): 'context': self._context, 'type': values.get('type') or 'form', }) - values.setdefault('return_url', False) _logger.info('payment.acquirer.render: <%s> values rendered for form payment:\n%s', self.provider, pprint.pformat(values)) return self.view_template_id.render(values, engine='ir.qweb') |
