changeset 65c9d5d703c3 in modules/sale_supply:default
details: 
https://hg.tryton.org/modules/sale_supply?cmd=changeset&node=65c9d5d703c3
description:
        Check if move has shipment before assigning inventory moves

        The moves on sale line do not always have a shipment, for example for 
drop
        shipment.

        issue11217
        review427641003
diffstat:

 sale.py |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (17 lines):

diff -r b1e9028b3fc4 -r 65c9d5d703c3 sale.py
--- a/sale.py   Mon May 02 17:40:07 2022 +0200
+++ b/sale.py   Thu Sep 08 12:56:39 2022 +0200
@@ -220,9 +220,10 @@
 
         moves = set()
         for move in self.moves:
-            for inv_move in move.shipment.inventory_moves:
-                if inv_move.product.id == self.product.id:
-                    moves.add(inv_move)
+            if move.shipment:
+                for inv_move in move.shipment.inventory_moves:
+                    if inv_move.product.id == self.product.id:
+                        moves.add(inv_move)
         to_write = []
         to_assign = []
         for move in moves:

Reply via email to