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'])