From 4712fddd88ca72b812bf966fdd9bde36feb36c7e Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 11 May 2016 17:03:53 +0200 Subject: [PATCH] [FIX] account: never allow modification of posted entries Posted moves are not protected from modification if the journal is set to 'autopost'. If an account move is posted in a journal with 'Autopost' set, it is possible to modify the associated move lines without any restriction. This can for example lead to the creation of unbalanced moves. The original issue fixed by this extra condition (https://bugs.launchpad.net/openobject-addons/+bug/615268) does not occur if the commit is reverted. This reverts 4e95e4223 Closes #12014 opw-683165 --- addons/account/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index fe893b9ccbe..84778dc0928 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1274,7 +1274,7 @@ class account_move_line(osv.osv): done = {} for line in self.browse(cr, uid, ids, context=context): err_msg = _('Move name (id): %s (%s)') % (line.move_id.name, str(line.move_id.id)) - if line.move_id.state <> 'draft' and (not line.journal_id.entry_posted): + if line.move_id.state <> 'draft': raise osv.except_osv(_('Error!'), _('You cannot do this modification on a confirmed entry. You can just change some non legal fields or you must unconfirm the journal entry first.\n%s.') % err_msg) if line.reconcile_id: raise osv.except_osv(_('Error!'), _('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg)