From bf4cdcaef3f412d7f791d1f92401822c7ba94566 Mon Sep 17 00:00:00 2001 From: Archana Vaghasiya Date: Tue, 21 Feb 2023 13:39:09 +0000 Subject: [PATCH] [FIX] stock: index error in stock_move while split_lines is empty An IndexError `list index out of range` trace back that occurs in stock/ stock_move : _onchange_move_line_ids was caught by sentry. because split_lines list is empty when user enter blank entry in value. So hear we check the split_lines is empty or not. sentry - 3942491608 closes odoo/odoo#113808 X-original-commit: 7e22d16681a68e15ba66bb2c81cd36ad19f6abff Signed-off-by: Adrien Widart --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 4e2fe04f84f..12374a69e08 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -1094,7 +1094,7 @@ Please change the quantity done or the rounding precision of your unit of measur if breaking_char in (move_line.lot_name or ''): split_lines = move_line.lot_name.split(breaking_char) split_lines = list(filter(None, split_lines)) - move_line.lot_name = split_lines[0] + move_line.lot_name = split_lines[0] if split_lines else '' move_lines_commands = self._generate_serial_move_line_commands( split_lines[1:], origin_move_line=move_line,