bzr revid: fp@tinyerp.com-20090116101836-e4rz24l7e448xi97
This commit is contained in:
Fabien Pinckaers 2009-01-16 11:18:36 +01:00
parent c4bd2a468b
commit dcde363845
1 changed files with 4 additions and 1 deletions

View File

@ -56,6 +56,7 @@ class account_invoice(osv.osv):
for line in invoice.tax_line:
res[invoice.id]['amount_tax'] += line.amount
res[invoice.id]['amount_total'] = res[invoice.id]['amount_tax'] + res[invoice.id]['amount_untaxed']
print 'res', res
return res
def _get_journal(self, cr, uid, context):
@ -473,10 +474,12 @@ 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')
self.button_compute(cr, uid, ids, context={}, set_total=False)
for inv in self.browse(cr, uid, ids):
if not inv.tax_line:
self.button_compute(cr, uid, [inv], 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: