[FIX] account: revert 6de2990f8 and proper fix
Revert "[FIX] account: reset the move reference on bank statement"
This reverts commit 6de2990f8d.
The previous patch was removing the reference of the move.
However, the reference is useful to reuse the name if the line is reconciled
again.
Instead, remove the constrain. To delete the move, account_cancel is already
needed. It is useful to allow removing statement lines to match the statements
form the bank and the one on Odoo.
In the future, allowing to set the amounts to zero should be added as a way to
correct the lines.
opw-741205
This commit is contained in:
@@ -4965,12 +4965,6 @@ msgstr ""
|
||||
msgid "It is mandatory to specify an account and a journal to create a write-off."
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
#: code:addons/account/models/account_bank_statement.py:408
|
||||
#, python-format
|
||||
msgid "It is not allowed to delete a bank statement line that already created a journal entry since it would create a gap in the numbering. You should create the journal entry again and cancel it thanks to a regular revert."
|
||||
msgstr ""
|
||||
|
||||
#. module: account
|
||||
#: code:addons/account/models/account_payment.py:322
|
||||
#, python-format
|
||||
|
||||
@@ -404,8 +404,6 @@ class AccountBankStatementLine(models.Model):
|
||||
for line in self:
|
||||
if line.journal_entry_ids.ids:
|
||||
raise UserError(_('In order to delete a bank statement line, you must first cancel it to delete related journal items.'))
|
||||
if line.move_name:
|
||||
raise UserError(_('It is not allowed to delete a bank statement line that already created a journal entry since it would create a gap in the numbering. You should create the journal entry again and cancel it thanks to a regular revert.'))
|
||||
return super(AccountBankStatementLine, self).unlink()
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -174,11 +174,6 @@ 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