[FIX] account: type builtin used as a local variable

Close #6901
This commit is contained in:
Leonardo Pistone 2015-05-29 17:30:36 +02:00 committed by Nicolas Martinelli
parent 0920c2fae0
commit 02ae76ce0b
1 changed files with 2 additions and 2 deletions

View File

@ -343,8 +343,8 @@ class account_invoice(models.Model):
# adapt selection of field journal_id
for field in res['fields']:
if field == 'journal_id' and type:
journal_select = self.env['account.journal']._name_search('', [('type', '=', type)], name_get_uid=1)
if field == 'journal_id' and context.get('journal_type'):
journal_select = self.env['account.journal']._name_search('', [('type', '=', context['journal_type'])], name_get_uid=1)
res['fields'][field]['selection'] = journal_select
doc = etree.XML(res['arch'])