=== modified file 'account/account_move_line.py' --- account/account_move_line.py 2011-10-24 07:25:44 +0000 +++ account/account_move_line.py 2011-11-26 10:12:15 +0000 @@ -1319,7 +1319,9 @@ tmp_cnt += 1 self.write(cr, uid,[result], { 'tax_code_id': tax[base_code], - 'tax_amount': tax[base_sign] * abs(total) + 'tax_amount': tax[base_sign] * abs(tax['price_unit']), + 'credit': tax['price_unit']<0 and -tax['price_unit'] or 0.0, + 'debit': tax['price_unit']>0 and tax['price_unit'] or 0.0, }) else: data = { @@ -1332,10 +1334,10 @@ 'ref': vals.get('ref',False), 'account_tax_id': False, 'tax_code_id': tax[base_code], - 'tax_amount': tax[base_sign] * abs(total), + 'tax_amount': tax[base_sign] * abs(tax['price_unit']), 'account_id': vals['account_id'], - 'credit': 0.0, - 'debit': 0.0, + 'credit': tax['price_unit']<0 and -tax['price_unit'] or 0.0, + 'debit': tax['price_unit']>0 and tax['price_unit'] or 0.0, } if data['tax_code_id']: self.create(cr, uid, data, context)