[FIX] account_voucher

bzr revid: mra@mra-laptop-20110215071001-ussdmt3p6cq5yz0v
This commit is contained in:
Mustufa Rangwala
2011-02-15 12:40:01 +05:30
parent 44d1f4b638
commit 9488656005
+3 -2
View File
@@ -752,15 +752,16 @@ class account_voucher(osv.osv):
if not currency_pool.is_zero(cr, uid, inv.currency_id, line_total):
diff = line_total
account_id = False
write_off_name = ''
if inv.payment_option == 'with_writeoff':
account_id = inv.writeoff_acc_id.id
name = inv.comment
write_off_name = inv.comment
elif inv.type in ('sale', 'receipt'):
account_id = inv.partner_id.property_account_receivable.id
else:
account_id = inv.partner_id.property_account_payable.id
move_line = {
'name': name,
'name': write_off_name or name,
'account_id': account_id,
'move_id': move_id,
'partner_id': inv.partner_id.id,