From 024ee89678ea9df2c0411ab03d4ca235e3d612f8 Mon Sep 17 00:00:00 2001 From: "Touati Djamel (otd)" Date: Mon, 27 Jun 2022 11:06:23 +0000 Subject: [PATCH] [FIX] product_expiry: filter quants by expiration alert date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Enable “Expiration date” in inventory settings - Create a Storable product “P1” - Tracking: by serial number - Enable the expiration date option - Update the quantity: - Create a new Lot “SN1”: - select today's date as the alert date - Go to inventory > reporting > Inventory Report - Try to filter by “Expiration Alerts” Problem: The product P1 is not selected, because the filter checks the removal date instead of the alert date Solution: The filter should check if the alert date is less than or equal to today's date to display products or not, as it is for lots: https://github.com/odoo/odoo/blob/14.0/addons/product_expiry/views/production_lot_views.xml#L30-L39 opw-2889737 closes odoo/odoo#95289 X-original-commit: 1c04bc5407f02c7299b86a7f4fef207f4aa01c77 Signed-off-by: Christophe Simonis --- addons/product_expiry/views/stock_quant_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product_expiry/views/stock_quant_views.xml b/addons/product_expiry/views/stock_quant_views.xml index 19666840e85..2fdb1a19f32 100644 --- a/addons/product_expiry/views/stock_quant_views.xml +++ b/addons/product_expiry/views/stock_quant_views.xml @@ -37,7 +37,7 @@ + domain="[('lot_id.alert_date', '<=', context_today().strftime('%Y-%m-%d'))]"/>