From 71d03fa5b2b4fb75edfad7caab912f391a2dc27f Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 22 Sep 2015 16:08:49 +0200 Subject: [PATCH] [FIX] glitches introduced during last forward-port (as always) --- addons/account/wizard/pos_box.py | 4 +--- openerp/tests/common.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py index 9bc30cf4c5c..aec1573c2a3 100644 --- a/addons/account/wizard/pos_box.py +++ b/addons/account/wizard/pos_box.py @@ -30,7 +30,6 @@ class CashBox(osv.osv_memory): for record in records: if not record.journal_id: raise UserError(_("Please check that the field 'Journal' is set on the Bank Statement")) - if not record.journal_id.internal_account_id: raise UserError(_("Please check that the field 'Internal Transfers Account' is set on the payment method '%s'.") % (record.journal_id.name,)) @@ -40,8 +39,7 @@ class CashBox(osv.osv_memory): def _create_bank_statement_line(self, cr, uid, box, record, context=None): if record.state == 'confirm': - raise osv.except_osv(_('Error!'), - _("You cannot put/take money in/out for a bank statement which is closed.")) + raise UserError(_("You cannot put/take money in/out for a bank statement which is closed.")) values = self._compute_values_for_statement_line(cr, uid, box, record, context=context) return self.pool.get('account.bank.statement').write(cr, uid, [record.id], {'line_ids': [(0, False, values)]}, context=context) diff --git a/openerp/tests/common.py b/openerp/tests/common.py index 6095ae03540..0bcc6fa1c43 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -147,7 +147,7 @@ class TransactionCase(BaseCase): @self.addCleanup def reset(): # rollback and close the cursor, and reset the environments - self.registry.clear_caches() + self.registry.clear_caches() self.env.reset() self.cr.rollback() self.cr.close()