changeset 4d0a595daf10 in modules/account_payment_stripe:5.4
details:
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=4d0a595daf10
description:
Support replacing party on customer
issue8851
review252661002
(grafted from 28a581fc43e7ae5ed5d071428e5e0a25b630bcf6)
diffstat:
__init__.py | 1 +
party.py | 12 +++++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diffs (37 lines):
diff -r 7a2e11fbf8a6 -r 4d0a595daf10 __init__.py
--- a/__init__.py Mon Nov 04 12:53:51 2019 +0100
+++ b/__init__.py Sat Nov 30 22:46:42 2019 +0100
@@ -23,6 +23,7 @@
module='account_payment_stripe', type_='model')
Pool.register(
payment.Checkout,
+ party.Replace,
module='account_payment_stripe', type_='wizard')
Pool.register(
payment.CheckoutPage,
diff -r 7a2e11fbf8a6 -r 4d0a595daf10 party.py
--- a/party.py Mon Nov 04 12:53:51 2019 +0100
+++ b/party.py Sat Nov 30 22:46:42 2019 +0100
@@ -3,7 +3,7 @@
from trytond.pool import PoolMeta
from trytond.model import fields
-__all__ = ['Party']
+__all__ = ['Party', 'Replace']
class Party(metaclass=PoolMeta):
@@ -11,3 +11,13 @@
stripe_customers = fields.One2Many(
'account.payment.stripe.customer', 'party', "Stripe Customers")
+
+
+class Replace(metaclass=PoolMeta):
+ __name__ = 'party.replace'
+
+ @classmethod
+ def fields_to_replace(cls):
+ return super().fields_to_replace() + [
+ ('account.payment.stripe.customer', 'party'),
+ ]