From e87c2d058d15e7622b0c43eba77dbee21174fc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 11 Oct 2016 18:18:01 +0200 Subject: [PATCH] Manage Replace Wizard issue5820 review26781002 --- __init__.py | 3 +++ party.py | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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'), + ]