summaryrefslogtreecommitdiff
path: root/addons/sale
diff options
context:
space:
mode:
authorwan <wan@odoo.com>2021-05-20 12:25:11 +0000
committerwan <wan@odoo.com>2021-05-20 12:25:11 +0000
commitef2d4f62e04c110fa6d36fa52ba4bfcc079d209f (patch)
tree181b03e8d9ec74926a64d632ee5e366c566940c0 /addons/sale
parent4f43dda7cd690bea780a209f48240ecf07e2f198 (diff)
[FIX] sale: use correct currency in tests
The main company can have something else than EUR or USD, especialy when testing localizations. closes odoo/odoo#71098 Signed-off-by: Josse Colpaert <jco@openerp.com>
Diffstat (limited to 'addons/sale')
-rw-r--r--addons/sale/tests/test_sale_order.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/sale/tests/test_sale_order.py b/addons/sale/tests/test_sale_order.py
index 3a9ace87e02..b79a5ec1845 100644
--- a/addons/sale/tests/test_sale_order.py
+++ b/addons/sale/tests/test_sale_order.py
@@ -375,7 +375,8 @@ class TestSaleOrder(TestSaleCommon):
# Make sure the company is in USD
main_company = self.env.ref('base.main_company')
main_curr = main_company.currency_id
- other_curr = (self.env.ref('base.USD') + self.env.ref('base.EUR')) - main_curr
+ current_curr = self.env.company.currency_id
+ other_curr = self.currency_data['currency']
# main_company.currency_id = other_curr # product.currency_id when no company_id set
other_company = self.env["res.company"].create({
"name": "Test",
@@ -401,8 +402,8 @@ class TestSaleOrder(TestSaleCommon):
self.assertEqual(product_1.currency_id, main_curr)
self.assertEqual(product_2.currency_id, main_curr)
- self.assertEqual(product_1.cost_currency_id, main_curr)
- self.assertEqual(product_2.cost_currency_id, main_curr)
+ self.assertEqual(product_1.cost_currency_id, current_curr)
+ self.assertEqual(product_2.cost_currency_id, current_curr)
product_1_ctxt = product_1.with_user(user_in_other_company)
product_2_ctxt = product_2.with_user(user_in_other_company)