From ee7c4d5585d4e46fc6d5483fece41747dfff2fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 11 Apr 2019 18:54:55 +0200 Subject: [PATCH] Unify _get_inventory_move on shipment Define them as instance method to provide more flexibility. issue8255 review287251002 --- stock.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/stock.py b/stock.py index 6cd0fca4cb..f8510717bc 100644 --- a/stock.py +++ b/stock.py @@ -151,9 +151,8 @@ class Move(metaclass=PoolMeta): class ShipmentIn(metaclass=PoolMeta): __name__ = 'stock.shipment.in' - @classmethod - def _get_inventory_moves(cls, incoming_move): - move = super(ShipmentIn, cls)._get_inventory_moves(incoming_move) + def _get_inventory_move(self, incoming_move): + move = super()._get_inventory_move(incoming_move) if move and incoming_move.lot: move.lot = incoming_move.lot return move @@ -205,10 +204,8 @@ class ShipmentOut(metaclass=PoolMeta): class ShipmentOutReturn(metaclass=PoolMeta): __name__ = 'stock.shipment.out.return' - @classmethod - def _get_inventory_moves(cls, incoming_move): - move = super(ShipmentOutReturn, - cls)._get_inventory_moves(incoming_move) + def _get_inventory_move(self, incoming_move): + move = super()._get_inventory_move(incoming_move) if move and incoming_move.lot: move.lot = incoming_move.lot return move