[FIX] Account: Customer / Supplier Journal item does not includes Refund journals

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

bzr revid: mra@mra-laptop-20110107103851-c1is63wymlpx05br
This commit is contained in:
Mustufa Rangwala 2011-01-07 16:08:51 +05:30
parent 75a74aa0a9
commit c21328f83c
1 changed files with 12 additions and 5 deletions

View File

@ -950,6 +950,13 @@ class account_move_line(osv.osv):
#Restrict the list of journal view in search view #Restrict the list of journal view in search view
if view_type == 'search' and result['fields'].get('journal_id', False): if view_type == 'search' and result['fields'].get('journal_id', False):
result['fields']['journal_id']['selection'] = journal_pool.name_search(cr, uid, '', [], context=context) result['fields']['journal_id']['selection'] = journal_pool.name_search(cr, uid, '', [], context=context)
ctx = context.copy()
if context.get('journal_type', False) == 'sale':
ctx.update({'journal_type': 'sale_refund'})
result['fields']['journal_id']['selection'] += journal_pool.name_search(cr, uid, '', [], context=ctx)
elif context.get('journal_type', False) == 'purchase':
ctx.update({'journal_type': 'purchase_refund'})
result['fields']['journal_id']['selection'] += journal_pool.name_search(cr, uid, '', [], context=ctx)
return result return result
if context.get('view_mode', False): if context.get('view_mode', False):
return result return result