Replace raise_user_error left by explicit raise

issue8356
review261531005
This commit is contained in:
Cédric Krier committed 2019-05-30 09:35:10 +02:00
1 parent 3cb3c17350
commit d842371ba7
1 file changed
+7 -4
+7 -4
View File
@@ -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))