From c25042df099b4c6447dc417dd2ea1102a6fc1ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 19 Sep 2026 15:36:05 +0200 Subject: [PATCH] Make Stripe idempotency key field readonly only once stored When copying the default value is set to None but the actual default value is a random value. This triggers the check of access right on the readonly field. --- modules/account_payment_stripe/payment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/account_payment_stripe/payment.py b/modules/account_payment_stripe/payment.py index 54a9862e7d..b4991701c3 100644 --- a/modules/account_payment_stripe/payment.py +++ b/modules/account_payment_stripe/payment.py @@ -162,8 +162,9 @@ class Payment(StripeCustomerMethodMixin, CheckoutMixin, metaclass=PoolMeta): | ~Eval('stripe_capture_needed')), }) stripe_idempotency_key = fields.Char( - "Stripe Idempotency Key", readonly=True, strip=False, + "Stripe Idempotency Key", strip=False, states={ + 'readonly': Eval('id', -1) >= 0, 'invisible': Eval('process_method') != 'stripe', }) stripe_error_message = fields.Char("Stripe Error Message", readonly=True,