changeset 5003727a3367 in modules/stock_package_shipping:default
details:
https://hg.tryton.org/modules/stock_package_shipping?cmd=changeset;node=5003727a3367
description:
Validate shipment before create shipping
This ensure the shipment is still valid to create shipping for the
carrier.
Otherwise it raises a nice error message.
issue9072
review303421002
diffstat:
stock.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diffs (13 lines):
diff -r d7b2cbdcd796 -r 5003727a3367 stock.py
--- a/stock.py Sat Apr 25 23:53:52 2020 +0200
+++ b/stock.py Tue Apr 28 00:32:33 2020 +0200
@@ -204,4 +204,9 @@
start = StateTransition()
def transition_start(self):
+ pool = Pool()
+ ShipmentOut = pool.get('stock.shipment.out')
+ shipment = ShipmentOut(Transaction().context['active_id'])
+ method_name = 'validate_packing_%' % shipment.carrier.shipping_service
+ getattr(shipment, method_name)()
return 'end'