From bb8bef5cff3b67e42218469e898f2b95e4ab315d Mon Sep 17 00:00:00 2001
From: "Touati Djamel (otd)" <otd@odoo.com>
Date: Fri, 15 Oct 2021 13:35:45 +0000
Subject: [PATCH] [FIX] product: display pricelists that have no defined end
 date
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Steps to reproduce the bug:
- Go to purchase > Configuration > Vendor Pricelists
- Filters > select the “Active” filter

Problem:
Currently, the filter does not include records that do not have a specified `”date_end”`, even though they are considered active.

Opw-2659829

closes odoo/odoo#78515

Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
---
 addons/product/views/product_views.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml
index 649ae939dfd1..c016817f4750 100644
--- a/addons/product/views/product_views.xml
+++ b/addons/product/views/product_views.xml
@@ -608,7 +608,7 @@
                 <search string="Vendor">
                     <field name="name"/>
                     <field name="product_tmpl_id"/>
-                    <filter string="Active" name="active" domain="[('date_end', '&gt;=',  (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
+                    <filter string="Active" name="active" domain="['|', ('date_end', '=', False), ('date_end', '&gt;=',  (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
                     <filter string="Archived" name="archived" domain="[('date_end', '&lt;',  (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
                     <group expand="0" string="Group By">
                         <filter string="Product" name="groupby_product" domain="[]" context="{'group_by': 'product_tmpl_id'}"/>
-- 
GitLab