From 737fccbbc2f2928c9c4b360f1991f196430e6759 Mon Sep 17 00:00:00 2001 From: "Javier Duran javier@vauxoo.com" <> Date: Mon, 10 Oct 2011 23:56:46 -0400 Subject: [PATCH] [REF] Including decimal precision on amount_residual calculated to avoid account move lines when we have little very little rounding problems bzr revid: javier@vauxoo.com-20111011035646-7jn8z1p8dw6l3f40 --- addons/account_voucher/account_voucher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 3e782b88f26..1cd7be48bff 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -864,8 +864,8 @@ class account_voucher(osv.osv): move_line['amount_currency'] = company_currency <> current_currency and sign * line.amount or 0.0 voucher_line = move_line_obj.create(cr, uid, move_line) rec_ids = [voucher_line, line.move_line_id.id] - - if amount_residual: # Change difference entry + print "What the fuck %s"% (self.pool.get('decimal.precision').precision_get(cr,uid,'Account')) + if round(amount_residual,self.pool.get('decimal.precision').precision_get(cr,uid,'Account')): # Change difference entry print "Amount Residual %s " % str(amount_residual) exch_lines = self._get_exchange_lines(cr, uid, line, move_id, amount_residual ,context)