Skip to content

Commit

Permalink
[FIX] account: reset the move reference on bank statement
Browse files Browse the repository at this point in the history
When removing a move previously linked to a bank statement, the move_name value
must be removed too.
This field is set when reconciling the entries.
When move_name is set, it is not possible to delete the bank statement line,
even if the refered move no longer exists.

opw-741205
  • Loading branch information
mart-e committed May 17, 2017
1 parent 57b3894 commit 6de2990
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/account/models/account_move.py
Expand Up @@ -174,6 +174,11 @@ def unlink(self):
#check the lock date + check if some entries are reconciled
move.line_ids._update_check()
move.line_ids.unlink()

# remove reference set at statement reconciliation
if move.statement_line_id.move_name:
move.statement_line_id.move_name = False

return super(AccountMove, self).unlink()

@api.multi
Expand Down

0 comments on commit 6de2990

Please sign in to comment.