From 345d88f7aa706fd8259ee4eeb4ba9a3e28c2ec79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 2 Oct 2016 15:21:20 +0200 Subject: [PATCH] Manage Replace Wizard issue5820 review32471002 --- __init__.py | 3 +++ party.py | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 02d48cb38a..90fd680fa2 100644 --- a/__init__.py +++ b/__init__.py @@ -30,3 +30,6 @@ def register(): Company, Employee, module='sale_opportunity', type_='model') + Pool.register( + PartyReplace, + module='sale_opportunity', type_='wizard') diff --git a/party.py b/party.py index b65e408751..48453e60ee 100644 --- a/party.py +++ b/party.py @@ -2,7 +2,7 @@ # this repository contains the full copyright notices and license terms. from trytond.pool import PoolMeta -__all__ = ['Party', 'Address'] +__all__ = ['Party', 'Address', 'PartyReplace'] class Party: @@ -15,3 +15,14 @@ class Address: __metaclass__ = PoolMeta __name__ = 'party.address' _history = True + + +class PartyReplace: + __metaclass__ = PoolMeta + __name__ = 'party.replace' + + @classmethod + def fields_to_replace(cls): + return super(PartyReplace, cls).fields_to_replace() + [ + ('sale.opportunity', 'party'), + ]