From d842371ba78e95366a25f8268be3b99c1bc7aab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 30 May 2019 09:35:10 +0200 Subject: [PATCH] Replace raise_user_error left by explicit raise issue8356 review261531005 --- party.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/party.py b/party.py index eb0c82e818..dd7b473d22 100644 --- a/party.py +++ b/party.py @@ -1,7 +1,10 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. +from trytond.i18n import gettext from trytond.pool import PoolMeta, Pool +from trytond.modules.party.exceptions import EraseError + __all__ = ['PartyReplace', 'PartyErase'] @@ -34,7 +37,7 @@ class PartyErase(metaclass=PoolMeta): ('state', 'not in', ['done', 'cancel']), ]) if shipments: - self.raise_user_error('pending_shipment', { - 'party': party.rec_name, - 'company': company.rec_name, - }) + raise EraseError( + gettext('stock.msg_erase_party_shipment', + party=party.rec_name, + company=company.rec_name))