Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
2fdb477b by Cédric Krier at 2023-06-07T16:53:24+02:00
Do not try to assign shipments that do not need to be assigned

Closes #12311
- - - - -


1 changed file:

- modules/stock/shipment.py


Changes:

=====================================
modules/stock/shipment.py
=====================================
@@ -961,6 +961,7 @@
     def assign_try(cls, shipments, with_childs=None):
         pool = Pool()
         Move = pool.get('stock.move')
+        shipments = [s for s in shipments if s.state == 'waiting']
         to_assign = defaultdict(list)
         for shipment in shipments:
             location_type = shipment.from_location.type
@@ -1704,6 +1705,10 @@
     @ModelView.button
     def assign_try(cls, shipments):
         Move = Pool().get('stock.move')
+        shipments = [
+            s for s in shipments
+            if s.state == 'waiting'
+            and s.warehouse_storage != s.warehouse_output]
         to_assign = [
             m for s in shipments for m in s.assign_moves
             if m.assignation_required]



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/2fdb477b01dd5cdd9a23f831edabef123f86b12a

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/2fdb477b01dd5cdd9a23f831edabef123f86b12a
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to