From 9123f8f022b8a7d024d3157606e3f65c5324fa1b Mon Sep 17 00:00:00 2001 From: Maxime Richez Date: Mon, 12 Apr 2021 19:43:05 +0200 Subject: [PATCH] Add wizard to unassign quantity from inventory moves on shipment issue9769 review306801011 --- stock.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stock.py b/stock.py index a4c898c923..2e1ba1a639 100644 --- a/stock.py +++ b/stock.py @@ -139,7 +139,8 @@ class ShipmentIn(metaclass=PoolMeta): def _get_inventory_move(self, incoming_move): move = super()._get_inventory_move(incoming_move) - move.secondary_unit = incoming_move.secondary_unit + if move: + move.secondary_unit = incoming_move.secondary_unit return move @@ -148,7 +149,8 @@ class ShipmentOut(metaclass=PoolMeta): def _get_inventory_move(self, move): inventory_move = super()._get_inventory_move(move) - inventory_move.secondary_unit = move.secondary_unit + if inventory_move: + inventory_move.secondary_unit = move.secondary_unit return inventory_move @@ -157,5 +159,6 @@ class ShipmentOutReturn(metaclass=PoolMeta): def _get_inventory_move(self, incoming_move): move = super()._get_inventory_move(incoming_move) - move.secondary_unit = incoming_move.secondary_unit + if move: + move.secondary_unit = incoming_move.secondary_unit return move