[IMP] account_voucher: Improve code of my last commit

bzr revid: psi@tinyerp.co.in-20110215064510-h10xngfhs0xvzv3b
This commit is contained in:
psi (Open ERP) 2011-02-15 12:15:10 +05:30
parent 16d8b6fa23
commit f935850255
1 changed files with 3 additions and 2 deletions

View File

@ -710,7 +710,7 @@ class account_voucher(osv.osv):
move_line = {
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
'name': line.name and line.name or '/',
'name': line.name or '/',
'account_id': line.account_id.id,
'move_id': move_id,
'partner_id': inv.partner_id.id,
@ -754,12 +754,13 @@ class account_voucher(osv.osv):
account_id = False
if inv.payment_option == 'with_writeoff':
account_id = inv.writeoff_acc_id.id
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': inv.comment and inv.comment or name,
'name': name,
'account_id': account_id,
'move_id': move_id,
'partner_id': inv.partner_id.id,