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.
This commit is contained in:
Cédric Krier
2026-09-19 15:36:05 +02:00
parent 49b16db32f
commit c25042df09
+2 -1
View File
@@ -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,