From 7fca8ad89eeb53844724c429e983085f8ddc6c4a Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 8 Nov 2016 11:11:12 +0100 Subject: [PATCH] [FIX] account: wrong amount with _prepare_analytic_line To have the right sign, amount = debit - credit Before the fix: -Create an invoice in another currency than the currency of your company -Link the invoice lines to an analytic account. -Validate the invoice. Bug: The analytic lines have a negative amount in the amount currency field which was a bit stange as it is the opposite sign than the amount in the company currency. opw:692557 --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 9ee01e8f251..034b412a35d 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1222,7 +1222,7 @@ class AccountMoveLine(models.Model): """ Prepare the values used to create() an account.analytic.line upon validation of an account.move.line having an analytic account. This method is intended to be extended in other modules. """ - amount = (self.credit or 0.0) - (self.debit or 0.0) + amount = (self.debit or 0.0) - (self.credit or 0.0) return { 'name': self.name, 'date': self.date,