diff --git a/__init__.py b/__init__.py index 01ea38bb5d..f449a8f1a3 100644 --- a/__init__.py +++ b/__init__.py @@ -14,3 +14,6 @@ def register(): BankAccountParty, Party, module='bank', type_='model') + Pool.register( + PartyReplace, + module='bank', type_='wizard') diff --git a/party.py b/party.py index 0b256e7d69..dd13292551 100644 --- a/party.py +++ b/party.py @@ -4,7 +4,7 @@ from trytond.pool import PoolMeta from trytond.model import fields -__all__ = ['Party'] +__all__ = ['Party', 'PartyReplace'] class Party: @@ -24,3 +24,15 @@ class Party: domain, ('bank_accounts',) + tuple(clause[1:]), ] + + +class PartyReplace: + __metaclass__ = PoolMeta + __name__ = 'party.replace' + + @classmethod + def fields_to_replace(cls): + return super(PartyReplace, cls).fields_to_replace() + [ + ('bank', 'party'), + ('bank.account-party.party', 'owner'), + ]