From 914da73d308c2eff2488cbe67350f5f52d17d21b Mon Sep 17 00:00:00 2001 From: "Tiffany Chang (tic)" Date: Mon, 27 Nov 2023 17:45:22 +0100 Subject: [PATCH] [FIX] purchase_mrp: avoid inconsistent test exchange rate Test was breaking during the nightly builds. Most likely due to the same issue as the one that odoo/odoo#131389 fixes, so we apply the same fix. closes odoo/odoo#144031 X-original-commit: 900373b2658240570f97998a7d86a6f4c3fb67fc Signed-off-by: Quentin Wolfs (quwo) Signed-off-by: Tiffany Chang (tic) --- .../purchase_mrp/tests/test_anglo_saxon_valuation.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/purchase_mrp/tests/test_anglo_saxon_valuation.py b/addons/purchase_mrp/tests/test_anglo_saxon_valuation.py index f7f5d268b93..c612d99f206 100644 --- a/addons/purchase_mrp/tests/test_anglo_saxon_valuation.py +++ b/addons/purchase_mrp/tests/test_anglo_saxon_valuation.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo.fields import Date +from odoo.fields import Date, Datetime from odoo.tools import mute_logger from odoo.tests import Form, tagged from odoo.tests.common import TransactionCase @@ -201,8 +201,14 @@ class TestAngloSaxonValuationPurchaseMRP(TransactionCase): # Setup Currency usd = self.env.ref('base.USD') eur = self.env.ref('base.EUR') - self.env['res.currency.rate'].create({'currency_id': usd.id, 'rate': 1}) - self.env['res.currency.rate'].create({'currency_id': eur.id, 'rate': 2}) + self.env['res.currency.rate'].create({ + 'name': Datetime.today(), + 'currency_id': usd.id, + 'rate': 1}) + self.env['res.currency.rate'].create({ + 'name': Datetime.today(), + 'currency_id': eur.id, + 'rate': 2}) # Create Purchase po_form = Form(self.env['purchase.order'])