[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) <arm@odoo.com>
This commit is contained in:
Arnold Moyaux
2023-11-06 18:11:38 +00:00
parent a0b52ab6bd
commit 9890fb7df7
2 changed files with 2 additions and 0 deletions
@@ -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);
+1
View File
@@ -38,6 +38,7 @@
<filter name="to_apply" string="To Apply" domain="[('inventory_quantity_set', '=', True)]"/>
<filter name="priority_products" string="Starred Products" domain="[('priority', '=', 1)]"/>
<separator/>
<filter name="in_stock" string="In Stock" domain="[('quantity', '&gt;', 0.0)]"/>
<filter name="conflicts" string="Conflicts" domain="[('is_outdated', '=', True)]"/>
<filter name="negative" string="Negative Stock" domain="[('quantity', '&lt;', 0.0)]"/>
<filter name="reserved" string="Reservations" domain="[('reserved_quantity', '&gt;', 0.0)]"/>