From 85aec52251a67992c7792313e16cc1433320bba8 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 5 Jun 2012 14:02:29 +0200 Subject: [PATCH] [FIX] account: check if the journal exist on the account.bank.statement bzr revid: stw@openerp.com-20120605120229-u37kbjcdp7nbpp6e --- addons/account/wizard/pos_box.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py index 00a3c404a65..12a606833a1 100644 --- a/addons/account/wizard/pos_box.py +++ b/addons/account/wizard/pos_box.py @@ -28,6 +28,10 @@ class CashBox(osv.osv_memory): def _run(self, cr, uid, ids, records, context=None): for box in self.browse(cr, uid, ids, context=context): for record in records: + if not record.journal_id: + raise osv.except_osv(_('Error !'), + _("Please check that the field 'Journal' is set on the Bank Statement")) + if not record.journal_id.internal_account_id: raise osv.except_osv(_('Error !'), _("Please check that the field 'Internal Transfers Account' is set on the payment method '%s'.") % (record.journal_id.name,))