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

Close #6901
This commit is contained in:
Leonardo Pistone
2015-07-07 12:47:13 +02:00
committed by Nicolas Martinelli
parent 0920c2fae0
commit 02ae76ce0b
+2 -2
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'])