[FIX] currency_rate_update: Change currency by SQL in tests

For avoiding the constraint.
This commit is contained in:
Pedro M. Baeza
2018-05-15 20:47:57 +02:00
committed by GitHub
parent 08e4a9d24b
commit a5822b5baa

View File

@@ -14,7 +14,11 @@ class TestCurrencyRateUpdate(TransactionCase):
def setUp(self):
super(TestCurrencyRateUpdate, self).setUp()
self.env.user.company_id.auto_currency_up = True
self.env.user.company_id.currency_id = self.env.ref('base.EUR')
self.env.cr.execute(
"""UPDATE res_company SET currency_id = %s
WHERE id = %s""",
(self.env.user.company_id.id, self.env.ref('base.EUR').id),
)
self.service_env = self.env['currency.rate.update.service']
self.rate_env = self.env['res.currency.rate']