[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user