[FIX] account_voucher: avoid trying unreconcile a move twice
When we cancel a voucher, we may be trying to unlink a reconciliation that was already removed on another move (just looking at the version in cache). In such cases, the unlink would fail with traceback. opw 610287
This commit is contained in:
parent
873dc0370d
commit
8f0392b490
|
@ -957,6 +957,8 @@ class account_voucher(osv.osv):
|
|||
# refresh to make sure you don't unlink an already removed move
|
||||
voucher.refresh()
|
||||
for line in voucher.move_ids:
|
||||
# refresh to make sure you don't unreconcile an already unreconciled entry
|
||||
line.refresh()
|
||||
if line.reconcile_id:
|
||||
move_lines = [move_line.id for move_line in line.reconcile_id.line_id]
|
||||
move_lines.remove(line.id)
|
||||
|
|
Loading…
Reference in New Issue