From 02ae76ce0b3f61444f9fbcd07ba1f2a92545d0ea Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Fri, 29 May 2015 17:30:36 +0200 Subject: [PATCH] [FIX] account: type builtin used as a local variable Close #6901 --- addons/account/account_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 154014368c3..4f539c86a0b 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -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'])