From b9034725299883f1aaebf32d5fe9670f948cb6de Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 25 Jun 2007 12:32:12 +0000 Subject: [PATCH] Improvement on invoice check bzr revid: fp@tinyerp.com-9a5f39b96c87913103ec7df9359f40c82a87c357 --- addons/account/invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index ad49122a266..557630ff3da 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -298,7 +298,8 @@ class account_invoice(osv.osv): for inv in self.browse(cr, uid, ids): if inv.move_id: continue - if inv.type in ('in_invoice', 'in_refund') and not inv.check_total == inv.amount_total: + if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0): + print inv.check_total, inv.amount_total raise osv.except_osv('Bad total !', 'Please verify the price of the invoice !\nThe real total does not match the computed total.') company_currency = inv.company_id.currency_id.id # create the analytical lines