From 993f09e1bc7908ad776c226d85cfd60d42d6f9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 18 Oct 2009 14:15:07 +0200 Subject: [PATCH] Add missing rounding on default computed tax amounts for issue1247 (transplanted from ed3e1afa545901dbf1e15ec482b7e9c2458956e8) --- move.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/move.py b/move.py index 7d9a44c750..9ddc434c87 100644 --- a/move.py +++ b/move.py @@ -526,6 +526,7 @@ class Line(OSV): tax_obj = self.pool.get('account.tax') account_obj = self.pool.get('account.account') tax_code_obj = self.pool.get('account.tax.code') + currency_obj = self.pool.get('currency.currency') values = super(Line, self).default_get(cursor, user, fields, context=context) @@ -638,6 +639,10 @@ class Line(OSV): line_amount -= tax_line['amount'] tax_amount += tax_line['amount'] * \ tax_line['tax'][key + '_tax_sign'] + line_amount = currency_obj.round(cursor, user, + line.account.company.currency, line_amount) + tax_amount = currency_obj.round(cursor, user, + line.account.company.currency, tax_amount) if ('debit' in fields): values['debit'] = line_amount > Decimal('0.0') \ and line_amount or Decimal('0.0')