[FIX] account: set default on journal_id in invoices should take care of the type of invoice, otherwise it just has no sense

bzr revid: qdp-launchpad@tinyerp.com-20110113165449-yvc7od4qu1dx3qhb
This commit is contained in:
qdp-launchpad@tinyerp.com 2011-01-13 17:54:49 +01:00
parent 8b0f3ace41
commit 02d6d22d49
1 changed files with 1 additions and 1 deletions

View File

@ -540,7 +540,7 @@ class account_invoice(osv.osv):
journal_ids = obj_journal.search(cr, uid, [('company_id','=',company_id), ('type', '=', journal_type)])
if journal_ids:
val['journal_id'] = journal_ids[0]
res_journal_default = self.pool.get('ir.values').get(cr, uid, 'default', False, ['account.invoice'])
res_journal_default = self.pool.get('ir.values').get(cr, uid, 'default', 'type=%s' % (type), ['account.invoice'])
for r in res_journal_default:
if r[1] == 'journal_id' and r[2] in journal_ids:
val['journal_id'] = r[2]