From bea3bf136c716bc6cf08b172d97ceee6039f9883 Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Fri, 8 May 2026 08:39:01 +0200 Subject: [PATCH] [FIX] product_pricelist_revision: Fix date range in duplicate wizard test Odoo 18 enforces a strict date_end > date_start constraint on pricelist items. The test was using the same datetime for both fields, causing a ValidationError. See https://github.com/odoo/odoo/blob/36a7cadbfb9007ebddd660b7709e4bef58e96c2d/addons/product/models/product_pricelist_item.py#L307 --- .../tests/test_product_pricelist_revision.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product_pricelist_revision/tests/test_product_pricelist_revision.py b/product_pricelist_revision/tests/test_product_pricelist_revision.py index 6c55495a905..d43edf93077 100644 --- a/product_pricelist_revision/tests/test_product_pricelist_revision.py +++ b/product_pricelist_revision/tests/test_product_pricelist_revision.py @@ -1,7 +1,7 @@ # Copyright 2019 Tecnativa - Ernesto Tejeda # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from datetime import datetime +from datetime import datetime, timedelta from odoo.addons.base.tests.common import BaseCommon @@ -94,7 +94,7 @@ def test_wizard_action_apply_and_compute_variation_percent(self): wizard = wizard_obj.with_context(active_ids=active_ids).create( { "date_start": datetime.now(), - "date_end": datetime.now(), + "date_end": datetime.now() + timedelta(hours=1), "variation_percent": 50, } )