From b53d3cd72649aafaa36e76690683e22e1dfa503e Mon Sep 17 00:00:00 2001 From: "Tiffany Chang (tic)" Date: Wed, 20 Dec 2023 13:39:24 +0100 Subject: [PATCH] [FIX] stock: always read field for default_order in move.line tree Previous PR odoo/odoo#143570 moved some move line ordering logic from the model to the view to avoid recomputing of these fields since it was causing issues with the computes occurring at the wrong time. Unfortunately every field used in the `default_order` in the view has to be present in the view and since v16 any fields that have a groups attribute that isn't met isn't loaded in the view. Therefore we have to force the `result_package_id` to always be in the view even if `stock.group_tracking_lot` is not true (i.e. packages are active) Steps to reproduce: - create +save a receipt with a tracked product - click on the burger button to open the detailed operations of the tracked product - add 2 move lines + Confirm Expected behavior: the move lines save Actual behavior: JS traceback due to trying to sort on a field that isn't present in the view closes odoo/odoo#147188 Signed-off-by: Quentin Wolfs (quwo) Signed-off-by: Tiffany Chang (tic) --- addons/stock/views/stock_move_views.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/views/stock_move_views.xml b/addons/stock/views/stock_move_views.xml index 786dbfdd066..2a7a9dd7964 100644 --- a/addons/stock/views/stock_move_views.xml +++ b/addons/stock/views/stock_move_views.xml @@ -196,6 +196,7 @@ + @@ -264,6 +265,7 @@ +