Add Stripe pull button to payment

This may be useful if events have been missed.
This commit is contained in:
Cédric Krier
2024-06-21 14:29:26 +02:00
parent 90fbb99ed2
commit ca69c82273
4 changed files with 20 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Add Stripe pull button to payment
* Warn when changing credential
Version 7.2.0 - 2024-04-29
+12
View File
@@ -250,6 +250,13 @@ class Payment(StripeCustomerMethodMixin, CheckoutMixin, metaclass=PoolMeta):
| ~Eval('stripe_capture_needed')),
'depends': ['state', 'stripe_capture_needed'],
},
'stripe_do_pull': {
'invisible': (
~Eval('stripe_charge_id')
& ~Eval('stripe_payment_intent_id')),
'depends': [
'stripe_charge_id', 'stripe_payment_intent_id'],
},
})
@classmethod
@@ -652,6 +659,11 @@ class Payment(StripeCustomerMethodMixin, CheckoutMixin, metaclass=PoolMeta):
stripe.error.APIConnectionError) as e:
logger.warning(str(e))
@classmethod
@ModelView.button
def stripe_do_pull(cls, payments):
cls.stripe_pull(payments)
@classmethod
def stripe_pull(cls, payments):
"Update payments with Stripe charges"
@@ -215,6 +215,12 @@ this repository contains the full copyright notices and license terms. -->
<field name="string">Stripe Capture</field>
</record>
<record model="ir.model.button" id="payment_stripe_pull_button">
<field name="model">account.payment</field>
<field name="name">stripe_do_pull</field>
<field name="string">Stripe Pull</field>
</record>
<record model="ir.ui.view" id="customer_view_form">
<field name="model">account.payment.stripe.customer</field>
<field name="type">form</field>
@@ -5,6 +5,7 @@ this repository contains the full copyright notices and license terms. -->
<xpath expr="//group[@id='buttons']" position="inside">
<button name="stripe_checkout"/>
<button name="stripe_do_capture"/>
<button name="stripe_do_pull"/>
</xpath>
<xpath expr="//field[@name='date']" position="after">
<group id="stripe" string="Stripe" colspan="4">