summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2013-11-18 17:56:31 +0100
committerMartin Trigaux <mat@openerp.com>2013-11-18 17:56:31 +0100
commitd3e25aa5e9177786cbdd398cd0dc7ad2160b3b62 (patch)
tree6346c360505d56da990861732b52cb0ab450d370
parentd23977c1060ca8f519ba663089c06ed07e33b3d9 (diff)
[IMP] account: cleanup
bzr revid: mat@openerp.com-20131118165631-13pfg3w6ri0zbuau
-rw-r--r--addons/account/account.py4
1 files changed, 3 insertions, 1 deletions
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".') % \