[FIX] account.move.line: no move revalidation for trivial changes
Many trivial changes to journal items, such as the "blocked" flag for litigation (follow-up), do not affect the balance of the whole entry. These should not cause the account.move to be (re)validated. For example it should be possible to change trivial fields even on journal entries recorded in a closed fiscal period.
This commit is contained in:
parent
0892a088fc
commit
f55a6046a8
|
@ -1172,8 +1172,10 @@ class account_move_line(osv.osv):
|
|||
raise osv.except_osv(_('Unable to change tax!'), _('You cannot change the tax, you should remove and recreate lines.'))
|
||||
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
|
||||
raise osv.except_osv(_('Bad Account!'), _('You cannot use an inactive account.'))
|
||||
if update_check:
|
||||
if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals) or ('date' in vals):
|
||||
|
||||
affects_move = any(f in vals for f in ('account_id', 'journal_id', 'period_id', 'move_id', 'debit', 'credit', 'date'))
|
||||
|
||||
if update_check and affects_move:
|
||||
self._update_check(cr, uid, ids, context)
|
||||
|
||||
todo_date = None
|
||||
|
@ -1198,7 +1200,8 @@ class account_move_line(osv.osv):
|
|||
if journal.centralisation:
|
||||
self._check_moves(cr, uid, context=ctx)
|
||||
result = super(account_move_line, self).write(cr, uid, ids, vals, context)
|
||||
if check and not context.get('novalidate'):
|
||||
|
||||
if affects_move and check and not context.get('novalidate'):
|
||||
done = []
|
||||
for line in self.browse(cr, uid, ids):
|
||||
if line.move_id.id not in done:
|
||||
|
|
Loading…
Reference in New Issue