changeset ae6079e9b14b in modules/sale_supply_drop_shipment:5.2
details: 
https://hg.tryton.org/modules/sale_supply_drop_shipment?cmd=changeset;node=ae6079e9b14b
description:
        Replace raise_user_error left by explicit raise

        issue8356
        review261531005
        (grafted from 3887603f4898ca2c8d7e0cc64acc7bb284fd22bb)
diffstat:

 party.py |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r 33f28d518ec8 -r ae6079e9b14b party.py
--- a/party.py  Mon May 06 15:14:12 2019 +0200
+++ b/party.py  Thu May 30 09:35:10 2019 +0200
@@ -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 @@
                 ('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))

Reply via email to