changeset 55dad43b3656 in modules/account_payment_stripe:default
details: 
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=55dad43b3656
description:
        Add model, record and records attribute on Wizard

        issue9421
        review309861012
diffstat:

 payment.py  |  15 +--------------
 payment.xml |   2 +-
 2 files changed, 2 insertions(+), 15 deletions(-)

diffs (37 lines):

diff -r 4e4dc68734da -r 55dad43b3656 payment.py
--- a/payment.py        Fri Jun 19 00:31:20 2020 +0200
+++ b/payment.py        Tue Jul 07 23:56:09 2020 +0200
@@ -1735,20 +1735,7 @@
     checkout = StateAction('account_payment_stripe.url_checkout')
 
     def do_checkout(self, action):
-        pool = Pool()
-        Payment = pool.get('account.payment')
-        Customer = pool.get('account.payment.stripe.customer')
-        context = Transaction().context
-        active_model = context['active_model']
-        active_id = context['active_id']
-        if active_model == Payment.__name__:
-            Model = Payment
-        elif active_model == Customer.__name__:
-            Model = Customer
-        else:
-            raise ValueError("Invalid active_model: %s" % active_model)
-        record = Model(active_id)
-        action['url'] = record.stripe_checkout_url
+        action['url'] = self.record.stripe_checkout_url
         return action, {}
 
 
diff -r 4e4dc68734da -r 55dad43b3656 payment.xml
--- a/payment.xml       Fri Jun 19 00:31:20 2020 +0200
+++ b/payment.xml       Tue Jul 07 23:56:09 2020 +0200
@@ -306,7 +306,7 @@
         <record model="ir.action.wizard" id="wizard_checkout">
             <field name="name">Stripe Checkout</field>
             <field name="wiz_name">account.payment.stripe.checkout</field>
-            <field name="model">account.payment</field>
+            <field name="model" eval="None"/>
         </record>
 
         <record model="ir.action.report" id="report_checkout">

Reply via email to