[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:
parent
73bdf34a66
commit
3542733e18
|
@ -306,9 +306,9 @@ class account_invoice(osv.osv):
|
||||||
view_id = view_id[0]
|
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)
|
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']:
|
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)
|
journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
|
||||||
res['fields'][field]['selection'] = journal_select
|
res['fields'][field]['selection'] = journal_select
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue