From 9890fb7df760e54e7dc901f2ac0d54d682304ee1 Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Mon, 6 Nov 2023 17:19:06 +0100 Subject: [PATCH] [FIX] stock: add filter on quantity in stock The on_hand filter is used from the product.product stat button. It's dangerous to modify it because the quantity with the filter would be different than the ones in the stat button. closes odoo/odoo#141272 Signed-off-by: Arnold Moyaux (arm) --- addons/stock/static/src/fields/stock_move_line_x2_many_field.js | 1 + addons/stock/views/stock_quant_views.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/stock/static/src/fields/stock_move_line_x2_many_field.js b/addons/stock/static/src/fields/stock_move_line_x2_many_field.js index 568cbf63567..c5e0e9398c8 100644 --- a/addons/stock/static/src/fields/stock_move_line_x2_many_field.js +++ b/addons/stock/static/src/fields/stock_move_line_x2_many_field.js @@ -37,6 +37,7 @@ export class SMLX2ManyField extends X2ManyField { single_product: true, tree_view_ref: "stock.view_stock_quant_tree_simple", search_default_on_hand: true, + search_default_in_stock: true, }; const productName = this.props.record.data.product_id[1]; const title = _t("Add line: %s", productName); diff --git a/addons/stock/views/stock_quant_views.xml b/addons/stock/views/stock_quant_views.xml index 3f259975123..c5cb339ddbf 100644 --- a/addons/stock/views/stock_quant_views.xml +++ b/addons/stock/views/stock_quant_views.xml @@ -38,6 +38,7 @@ +