From 3d967d97d30a716ddcbfa768031f39e51aa4411f Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Wed, 18 Aug 2010 16:49:45 +0200 Subject: [PATCH] [FIX] account: the encoding entries by line wasn't working if there was no journal of the type passed in context bzr revid: qdp-launchpad@tinyerp.com-20100818144945-pb4n5x772iginqr7 --- addons/account/wizard/account_move_journal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index 79f41ec2d46..1d0dce85910 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -47,6 +47,8 @@ class account_move_journal(osv.osv_memory): journal_pool = self.pool.get('account.journal') if context.get('journal_type', False): jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))]) + if not jids: + raise osv.except_osv(_('Configuration Error !'), _('Can\'t find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Financial Accounting\Accounts\Journals.' % (context.get('journal_type')))) journal_id = jids[0] return journal_id