From 2d54afef9e72a27e9c8e60a9cecb41f08a0cb693 Mon Sep 17 00:00:00 2001 From: cod-odoo Date: Mon, 28 Jul 2014 16:10:46 +0530 Subject: [PATCH] [FIX] account: prevent crash onchange company_id (rebase of #1534) --- 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 1092ec33aea..5b45f8dd02a 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -572,8 +572,8 @@ class account_invoice(models.Model): if 'journal_id' in journal_defaults: values['journal_id'] = journal_defaults['journal_id'] if not values.get('journal_id'): - field_desc = journals.fields_get(['journal_id']) - type_label = next(t for t, label in field_desc['journal_id']['selection'] if t == journal_type) + field_desc = journals.fields_get(['type']) + type_label = next(t for t, label in field_desc['type']['selection'] if t == journal_type) action = self.env.ref('account.action_account_journal_form') msg = _('Cannot find any account journal of type "%s" for this company, You should create one.\n Please go to Journal Configuration') % type_label raise RedirectWarning(msg, action.id, _('Go to the configuration panel'))