summaryrefslogtreecommitdiff
path: root/addons/hr_expense/tests
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2019-05-22 09:03:55 +0000
committerYannick Tivisse <yti@odoo.com>2019-05-29 08:09:15 +0000
commitf5dfe4727c086c7577da2aef12c2d3548ba938a3 (patch)
tree8af04c84c18ded0c1ed48c7c61640021dd9d24cb /addons/hr_expense/tests
parent11cab26fb0f2167bfccfc3f11db10ff308f067b4 (diff)
[IMP] api.py: Rename company_id/company_ids into company/companies
The goal is to be coherent with the user property. Actually, company_id and company_ids on the environment are no fields. Calling env.company_id returns a browse record, not an id.
Diffstat (limited to 'addons/hr_expense/tests')
-rw-r--r--addons/hr_expense/tests/test_expenses.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/hr_expense/tests/test_expenses.py b/addons/hr_expense/tests/test_expenses.py
index 5ab7abe3d67..ab31f29c804 100644
--- a/addons/hr_expense/tests/test_expenses.py
+++ b/addons/hr_expense/tests/test_expenses.py
@@ -83,11 +83,11 @@ class TestAccountEntry(TestExpenseCommon):
multi-currency. And taxes. """
# Clean-up the rates
- self.cr.execute("UPDATE res_company SET currency_id = %s WHERE id = %s", [self.env.ref('base.USD').id, self.env.company_id.id])
+ self.cr.execute("UPDATE res_company SET currency_id = %s WHERE id = %s", [self.env.ref('base.USD').id, self.env.company.id])
self.env['res.currency.rate'].search([]).unlink()
self.env['res.currency.rate'].create({
'currency_id': self.env.ref('base.EUR').id,
- 'company_id': self.env.company_id.id,
+ 'company_id': self.env.company.id,
'rate': 2.0,
'name': '2010-01-01',
})
@@ -142,7 +142,7 @@ class TestAccountEntry(TestExpenseCommon):
self.assertEquals(self.analytic_account.line_ids, expense.account_move_id.mapped('line_ids.analytic_line_ids'))
self.assertEquals(len(self.analytic_account.line_ids), 1, "Analytic Account should have only one line")
self.assertAlmostEquals(self.analytic_account.line_ids[0].amount, -318.18, "Amount on the only AAL is wrong")
- self.assertAlmostEquals(self.analytic_account.line_ids[0].currency_id, self.env.company_id.currency_id, "Currency on the only AAL is wrong")
+ self.assertAlmostEquals(self.analytic_account.line_ids[0].currency_id, self.env.company.currency_id, "Currency on the only AAL is wrong")
self.assertEquals(self.analytic_account.line_ids[0].product_id, self.product_expense, "Product of AAL should be the one from the expense")
def test_expense_from_email(self):