changeset 28a581fc43e7 in modules/account_payment_stripe:default
details:
https://hg.tryton.org/modules/account_payment_stripe?cmd=changeset;node=28a581fc43e7
description:
Support replacing party on customer
issue8851
review252661002
diffstat:
__init__.py | 1 +
party.py | 12 +++++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
diffs (37 lines):
diff -r 704a75e6416e -r 28a581fc43e7 __init__.py
--- a/__init__.py Tue Nov 26 22:16:00 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 704a75e6416e -r 28a581fc43e7 party.py
--- a/party.py Tue Nov 26 22:16:00 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'),
+ ]