[FIX] account: _prepare_analytic_line

In function _compute_expense_totals, the debit and credit of an account
move is computed in the right currency rate according to the date.
Then in function _prepare_analytic_line, the amount of an analytic line
must also be computed in the right currency according to the date.

opw:666538
This commit is contained in:
Goffin Simon
2016-01-20 12:58:32 +01:00
parent e381b7e31a
commit 366980e550
+1 -1
View File
@@ -1103,7 +1103,7 @@ class AccountMoveLine(models.Model):
'unit_amount': self.quantity,
'product_id': self.product_id and self.product_id.id or False,
'product_uom_id': self.product_uom_id and self.product_uom_id.id or False,
'amount': self.company_currency_id.compute(amount, self.currency_id) if self.currency_id else amount,
'amount': self.company_currency_id.with_context(date=self.date or fields.Date.context_today(self)).compute(amount, self.currency_id) if self.currency_id else amount,
'general_account_id': self.account_id.id,
'ref': self.ref,
'move_id': self.id,