From 126df41f3d99cdfda6918092d5fa231936ac17f6 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 24 May 2017 11:33:22 +0200 Subject: [PATCH] [FIX] account: revert 6de2990f8 and proper fix Revert "[FIX] account: reset the move reference on bank statement" This reverts commit 6de2990f8d45074d39917ab132791b3ddc7e6e30. 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 --- addons/account/i18n/account.pot | 6 ------ addons/account/models/account_bank_statement.py | 2 -- addons/account/models/account_move.py | 5 ----- 3 files changed, 13 deletions(-) diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 9357316cf50..5f23675e9b0 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -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 diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 01573491a69..06556747fb2 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -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 diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 21e70f83ff9..bae80439415 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -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