From 5cec1fc94d9515293ba8d9212eeed994697e9ab8 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Thu, 2 Feb 2023 15:32:49 +0000 Subject: [PATCH] [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) Signed-off-by: Pedram Bi Ria (pebr) --- addons/pos_stripe/models/pos_payment_method.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/pos_stripe/models/pos_payment_method.py b/addons/pos_stripe/models/pos_payment_method.py index 69585204d0a..45b0f886e8d 100644 --- a/addons/pos_stripe/models/pos_payment_method.py +++ b/addons/pos_stripe/models/pos_payment_method.py @@ -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