[FIX] sale_expense,sale: fix tests that depend of the USD currency
The assertEqual compare arbitrary amounts related to the USD. This leads to error when changing the currency of the base.main_company.
This commit is contained in:
@@ -24,6 +24,9 @@ class TestOnchangeProductId(TransactionCase):
|
||||
self.pricelist_model = self.env['product.pricelist']
|
||||
|
||||
def test_onchange_product_id(self):
|
||||
# Ensure the computation are done with the USD currency
|
||||
base_company = self.env.ref('base.main_company')
|
||||
base_company.currency_id = self.env.ref('base.USD')
|
||||
|
||||
uom_id = self.product_uom_model.search([('name', '=', 'Unit(s)')])[0]
|
||||
pricelist = self.pricelist_model.search([('name', '=', 'Public Pricelist')])[0]
|
||||
|
||||
@@ -104,6 +104,10 @@ class TestSaleOrder(TestSale):
|
||||
|
||||
def test_cost_invoicing(self):
|
||||
""" Test confirming a vendor invoice to reinvoice cost on the so """
|
||||
# Ensure the computation are done with the USD currency
|
||||
base_company = self.env.ref('base.main_company')
|
||||
base_company.currency_id = self.env.ref('base.USD')
|
||||
|
||||
serv_cost = self.env.ref('product.service_cost_01')
|
||||
prod_gap = self.env.ref('product.product_product_1')
|
||||
so = self.env['sale.order'].create({
|
||||
|
||||
@@ -7,6 +7,9 @@ from odoo.addons.sale.tests.test_sale_common import TestSale
|
||||
class TestSaleExpense(TestSale):
|
||||
def test_sale_expense(self):
|
||||
""" Test the behaviour of sales orders when managing expenses """
|
||||
# Ensure the computation are done with the USD currency
|
||||
base_company = self.env.ref('base.main_company')
|
||||
base_company.currency_id = self.env.ref('base.USD')
|
||||
# create a so with a product invoiced on delivery
|
||||
prod = self.env.ref('product.product_product_1')
|
||||
so = self.env['sale.order'].create({
|
||||
|
||||
Reference in New Issue
Block a user