From d3e25aa5e9177786cbdd398cd0dc7ad2160b3b62 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 18 Nov 2013 17:56:31 +0100 Subject: [PATCH] [IMP] account: cleanup bzr revid: mat@openerp.com-20131118165631-13pfg3w6ri0zbuau --- addons/account/account.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 7c2cef803ce..f3abf3ee07b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1456,9 +1456,11 @@ class account_move(osv.osv): def unlink(self, cr, uid, ids, context=None, check=True): if context is None: context = {} + if isinstance(ids, (int, long)): + ids = [ids] toremove = [] obj_move_line = self.pool.get('account.move.line') - for move in self.browse(cr, uid, (ids if hasattr(ids, '__iter__') else [ids]), context=context): + for move in self.browse(cr, uid, ids, context=context): if move['state'] != 'draft': raise osv.except_osv(_('User Error!'), _('You cannot delete a posted journal entry "%s".') % \