From 9f6ea169430bf8c918c2a3e3ab2c155bb0fe644e Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Wed, 9 Aug 2023 10:04:05 +0000 Subject: [PATCH] [FIX] purchase_requisition: Fix failing test During the test, the rate are created on UTC timezone. However the test could be run with a different timezone. Since the rate doens't have a name, by default they have the create date name. However due to timezone difference, it could be different day and the newly created rate for the test will be filter out closes odoo/odoo#131708 X-original-commit: 300fe8ad36163b6ad7f8a37ac26b014c1510d64f Signed-off-by: William Henrotin (whe) --- .../purchase_requisition/tests/test_purchase_requisition.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase_requisition/tests/test_purchase_requisition.py b/addons/purchase_requisition/tests/test_purchase_requisition.py index 5a58dbdebf3..60864a696b4 100644 --- a/addons/purchase_requisition/tests/test_purchase_requisition.py +++ b/addons/purchase_requisition/tests/test_purchase_requisition.py @@ -2,7 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.purchase_requisition.tests.common import TestPurchaseRequisitionCommon -from odoo import Command +from odoo import Command, fields from odoo.tests import Form from datetime import timedelta @@ -351,16 +351,16 @@ class TestPurchaseRequisition(TestPurchaseRequisitionCommon): def test_12_alternative_po_line_different_currency(self): """ Check alternative PO with different currency is compared correctly""" - currency_eur = self.env.ref("base.EUR") currency_usd = self.env.ref("base.USD") (currency_usd | currency_eur).active = True - # 1 USD = 0.5 EUR self.env['res.currency.rate'].create([{ + 'name': fields.Datetime.today(), 'currency_id': self.env.ref('base.USD').id, 'rate': 1, }, { + 'name': fields.Datetime.today(), 'currency_id': self.env.ref('base.EUR').id, 'rate': 0.5, }])