[FIX] account: fields_view_get of account.invoice should not filter the journals if nothing is passed in context

lp bug: https://launchpad.net/bugs/871960 fixed

bzr revid: qdp-launchpad@openerp.com-20111109110704-yla19u2o2r2ctico
This commit is contained in:
Quentin (OpenERP) 2011-11-09 12:07:04 +01:00
parent 73bdf34a66
commit 3542733e18
1 changed files with 2 additions and 2 deletions

View File

@ -306,9 +306,9 @@ class account_invoice(osv.osv):
view_id = view_id[0]
res = super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
type = context.get('journal_type', 'sale')
type = context.get('journal_type', False)
for field in res['fields']:
if field == 'journal_id':
if field == 'journal_id' and type:
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
res['fields'][field]['selection'] = journal_select