[FIX] pos_stripe: capture payment with non-admin user

Before this commit: if a non-admin user captured a payment with
PoS Stripe, an error occurred in UI. The problem is that only the
"Administration / Settings" group can have access to the payment
provider.

The solution is to use super user mode.

opw-3120441

closes odoo/odoo#112006

X-original-commit: de096c08f5766f3fb2b2438730295195cdd9af16
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
pedrambiria
2023-02-06 16:28:47 +01:00
parent 89f12d66b9
commit 5cec1fc94d
@@ -110,7 +110,7 @@ class PosPaymentMethod(models.Model):
"amount_to_capture": self._stripe_calculate_amount(amount),
}
return self._get_stripe_payment_provider()._stripe_make_request(endpoint, data)
return self.sudo()._get_stripe_payment_provider()._stripe_make_request(endpoint, data)
def action_stripe_key(self):
res_id = self._get_stripe_payment_provider().id