[FIX] account: do not validate move when novalidate is in context

The key 'novalidate' is added in the context when an operation not impacting
the validation of a move is made. The validation recreates analytic lines
which decrease the performances.

In case of registrating a payment, the skipped validation are the one from
the reconcile method (reconciliation does not change the validity)
Fixes #3787, opw 618529
This commit is contained in:
Stéphane Bidoul 2014-11-21 00:38:39 +01:00 committed by Martin Trigaux
parent eaef500e9d
commit c68ecbe093
1 changed files with 1 additions and 1 deletions

View File

@ -1197,7 +1197,7 @@ 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:
if check and not context.get('novalidate'):
done = []
for line in self.browse(cr, uid, ids):
if line.move_id.id not in done: