diff -r 8a6a82c717d6 stock.py --- a/trytond/trytond/modules/stock_lot/stock.py Tue Jul 10 12:57:12 2018 +0200 +++ b/trytond/trytond/modules/stock_lot/stock.py Tue Jul 10 12:58:45 2018 +0200 @@ -159,6 +159,20 @@ 'lot_required': 'Lot is required for move of product "%s".', }) + @classmethod + def assign_try(cls, moves, with_childs=True, grouping=('product',)): + lot_moves = [] + product_moves = [] + for move in moves: + if move.lot: + lot_moves.append(move) + else: + product_moves.append(move) + return (super(Move, cls).assign_try(lot_moves, + with_childs=with_childs, grouping=('product', 'lot')) + & super(Move, cls).assign_try(product_moves, + with_childs=with_childs, grouping=grouping)) + def check_lot(self): "Check if lot is required" if (self.state == 'done'