From e3580ab884902b58349dcfc2377de1939fc7ffe2 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 13 Nov 2014 12:42:18 +0100 Subject: [PATCH] [FIX] account_voucher: getting default invoice crashes Fixes #3524. --- addons/account_voucher/account_voucher.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index e1483ab0188..78060e8a733 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -125,6 +125,9 @@ class account_voucher(osv.osv): journal_pool = self.pool.get('account.journal') journal_id = context.get('journal_id', False) if journal_id: + if isinstance(journal_id, (list, tuple)): + # sometimes journal_id is a pair (id, display_name) + journal_id = journal_id[0] journal = journal_pool.browse(cr, uid, journal_id, context=context) if journal.currency: return journal.currency.id