bzr revid: fp@tinyerp.com-20090116110001-hrxdmhltuflegjd9
This commit is contained in:
Fabien Pinckaers 2009-01-16 12:00:01 +01:00
commit 886c9eedcf
1 changed files with 3 additions and 2 deletions

View File

@ -474,12 +474,13 @@ class account_invoice(osv.osv):
def action_move_create(self, cr, uid, ids, *args):
ait_obj = self.pool.get('account.invoice.tax')
cur_obj = self.pool.get('res.currency')
for inv in self.browse(cr, uid, ids):
if not inv.tax_line:
self.button_compute(cr, uid, [inv], context={}, set_total=False)
self.button_compute(cr, uid, [inv.id], context={}, set_total=False)
if inv.move_id:
continue
print 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):
raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.'))
if not inv.date_invoice: