Skip to content
Permalink
Browse files

[FIX] payment: prevent ACL denial when unlinking onboarding wizard

Since wizards shall not be unlinked by anyone, but as we want to get rid
of this specific one immediately to get rid of eventual credentials,
do it with elevated privileges.

Before this commit, the behavior was an authorization error when trying
to applying the payment method, in a fresh invoicing configuration.

closes #45327

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
  • Loading branch information
madprog committed Feb 13, 2020
1 parent 2942826 commit c8ee9c73d4ac9989d05843a32abc535b20d761b4
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/payment/wizards/payment_acquirer_onboarding_wizard.py
@@ -142,7 +142,7 @@ def add_payment_methods(self):
raise UserError(_("You have to set a journal for your payment acquirer %s." % (self.manual_name,)))

# delete wizard data immediately to get rid of residual credentials
self.unlink()
self.sudo().unlink()
# the user clicked `apply` and not cancel so we can assume this step is done.
self._set_payment_acquirer_onboarding_step_done()
return {'type': 'ir.actions.act_window_close'}

0 comments on commit c8ee9c7

Please sign in to comment.
You can’t perform that action at this time.