summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Smet <las@odoo.com>2020-07-14 07:24:06 +0000
committerLaurent Smet <las@odoo.com>2020-07-15 07:12:25 +0000
commit61351ec2763c85b59dcbfd44b2e6fcf6d8c54104 (patch)
tree9be7da71690a05595058d826c0d681b2de6b91aa
parent14940225f2f85fb0697aa1b39a492d6077f55f0a (diff)
[FIX] account: Use CoA's currency by default on testing company
If a test is supposed to be run with the Belgium CoA, we expect the company is created by default with the EUR currency. Before this commit, the currency of the company was replaced by the current company's one: USD (most of the time).
-rw-r--r--addons/account/tests/common.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/account/tests/common.py b/addons/account/tests/common.py
index 0cebdeb16ee..3499c45efdc 100644
--- a/addons/account/tests/common.py
+++ b/addons/account/tests/common.py
@@ -814,10 +814,8 @@ class AccountTestInvoicingCommon(SavepointCase):
return account
chart_template = chart_template or cls.env.company.chart_template_id
- currency = cls.env.user.company_id.currency_id
company = cls.env['res.company'].create({
'name': company_name,
- 'currency_id': currency.id,
**kwargs,
})
cls.env.user.company_ids |= company
@@ -825,7 +823,8 @@ class AccountTestInvoicingCommon(SavepointCase):
chart_template.try_loading(company=company)
# The currency could be different after the installation of the chart template.
- company.write({'currency_id': kwargs.get('currency_id', currency.id)})
+ if kwargs.get('currency_id'):
+ company.write({'currency_id': kwargs['currency_id']})
return {
'company': company,