Improvement on invoice check

bzr revid: fp@tinyerp.com-9a5f39b96c87913103ec7df9359f40c82a87c357
This commit is contained in:
Fabien Pinckaers 2007-06-25 12:32:12 +00:00
parent 53b28a6564
commit b903472529
1 changed files with 2 additions and 1 deletions

View File

@ -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