[IMP] account:-set default journal on customer&vendor,invoices and refund as per its type

bzr revid: mtr@mtr-20100901055333-ux5bqzhwjz2rx71s
This commit is contained in:
mtr 2010-09-01 11:23:33 +05:30
parent 8197f130f3
commit 03694ad12a
1 changed files with 5 additions and 1 deletions

View File

@ -527,8 +527,12 @@ class account_invoice(osv.osv):
else:
continue
if company_id and type:
if type in ('out_invoice', 'out_refund'):
if type in ('out_invoice'):
journal_type = 'sale'
elif type in ('out_refund'):
journal_type = 'sale_refund'
elif type in ('in_refund'):
journal_type = 'purchase_refund'
else:
journal_type = 'purchase'
journal_ids = obj_journal.search(cr, uid, [('company_id','=',company_id), ('type', '=', journal_type)])