From c71cc3e686e8549899ce7079ff55ff0f7f8f1bc4 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Wed, 20 Apr 2011 11:37:17 +0530 Subject: [PATCH] [FIX] account_voucher: correct red fields..error when default account not set on journal bzr revid: ara@tinyerp.com-20110420060717-2wm93bmrbm35333i --- addons/account_voucher/account_voucher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 9bfee8b8d49..b4422cd8051 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -379,6 +379,8 @@ class account_voucher(osv.osv): account_id = partner.property_account_payable.id tr_type = 'purchase' else: + if not journal.default_credit_account_id or not journal.default_debit_account_id: + raise osv.except_osv(_('Error !'), _('Please define default credit/debit account on the %s !') % (journal.name)) account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id tr_type = 'receipt'