[FIX] purchase: fix test
The `price_unit` on `stock.move` is not rounded since it is a technical field. Therefore, the comparison might fail depending on the rate (which happens after June 6th because of `base.rateUSDbis`).
This commit is contained in:
@@ -182,7 +182,7 @@ class TestStockValuation(TransactionCase):
|
||||
'company_id': po1.company_id.id,
|
||||
})
|
||||
eur_currency._compute_current_rate()
|
||||
price_unit_usd_new_rate = po1.currency_id.compute(po1.order_line.price_unit, po1.company_id.currency_id, round=True)
|
||||
price_unit_usd_new_rate = po1.currency_id.compute(po1.order_line.price_unit, po1.company_id.currency_id, round=False)
|
||||
|
||||
# the new price_unit is lower than th initial because of the rate's change
|
||||
self.assertLess(price_unit_usd_new_rate, price_unit_usd)
|
||||
@@ -196,7 +196,7 @@ class TestStockValuation(TransactionCase):
|
||||
wizard.process()
|
||||
|
||||
# the unit price of the stock move has been updated to the latest value
|
||||
self.assertEquals(move1.price_unit, price_unit_usd_new_rate)
|
||||
self.assertAlmostEqual(move1.price_unit, price_unit_usd_new_rate)
|
||||
|
||||
self.assertAlmostEqual(self.product1.stock_value, price_unit_usd_new_rate * 10, delta=0.1)
|
||||
|
||||
@@ -407,4 +407,3 @@ class TestStockValuationWithCOA(AccountingTestCase):
|
||||
# check the anglo saxon entries
|
||||
price_diff_entry = self.env['account.move.line'].search([('account_id', '=', price_diff_account.id)])
|
||||
self.assertEqual(price_diff_entry.credit, 100)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user