[FIX] account: reset the move reference on bank statement

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
This commit is contained in:
Martin Trigaux
2017-05-17 15:21:43 +02:00
parent 57b3894ca0
commit 6de2990f8d
+5
View File
@@ -174,6 +174,11 @@ class AccountMove(models.Model):
#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