[FIX] account: Advance search on 'Tax' from journal items leads to traceback if we do not select any journal. (Maintenance Case: 606875)

bzr revid: rgo@tinyerp.com-20140422111115-17e6juruftp3oj2r
This commit is contained in:
Ravi Gohil (OpenERP) 2014-04-22 16:41:15 +05:30
parent 322eebf3f7
commit 70dc4456d7
1 changed files with 1 additions and 1 deletions

View File

@ -1964,7 +1964,7 @@ class account_tax(osv.osv):
elif context.get('type') in ('in_invoice','in_refund'):
args += [('type_tax_use','in',['purchase','all'])]
if context and context.has_key('journal_id'):
if context and context.get('journal_id'):
journal = journal_pool.browse(cr, uid, context.get('journal_id'))
if journal.type in ('sale', 'purchase'):
args += [('type_tax_use','in',[journal.type,'all'])]