[FIX] stock: leap year in test
The test returns an error if today is within 365 days before the next 29th February: datetime.date(2024, 3, 1) != datetime.date(2024, 2, 29) closes odoo/odoo#114053 X-original-commit: 880c0a76ac6333cbc9a8e89c865eb6caf309e0e3 Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com> Signed-off-by: Diez Stéphane (snd) <snd@odoo.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from datetime import date, datetime, timedelta
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.tests.common import Form, TransactionCase
|
||||
@@ -517,4 +518,4 @@ class TestInventory(TransactionCase):
|
||||
self.assertEqual(existing_loc2.next_inventory_date, date.today() + timedelta(days=2))
|
||||
self.assertEqual(quant_new_loc.inventory_date, date.today() + timedelta(days=2))
|
||||
self.assertEqual(quant_existing_loc.inventory_date, date.today() + timedelta(days=2))
|
||||
self.assertEqual(quant_non_cyclic_loc.inventory_date, date.today() + timedelta(days=365))
|
||||
self.assertEqual(quant_non_cyclic_loc.inventory_date, date.today() + relativedelta(years=1))
|
||||
|
||||
Reference in New Issue
Block a user