[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
This commit is contained in:
parent
3418b9f8aa
commit
4712fddd88
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue