[FIX] account: check if the journal exist on the account.bank.statement

bzr revid: stw@openerp.com-20120605120229-u37kbjcdp7nbpp6e
This commit is contained in:
Stephane Wirtel
2012-06-05 14:02:29 +02:00
parent 668b82d0a9
commit 85aec52251
+4
View File
@@ -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,))