diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-05-08 14:05:37 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2017-05-08 15:37:25 +0200 |
| commit | 8d9f0c8d941565f3831adef4c12b94cb97ed8be9 (patch) | |
| tree | bf0fa1f6e429c96e451225c958f78c3429a4a9fb | |
| parent | ee6e2f57712c8abd4020d09fd0c5cc05a15c6e99 (diff) | |
[FIX] account: double journal entry in reconciliation
- Create a bank statement for Partner A, with one line of 1000 EUR
- Open the reconciliation widget (click on "Reconcile")
- Using another browser, open the same reconciliation widget
- Create an entry for the opened balance in browser 1, click on
"Reconcile"
- Create an entry for the opened balance in browser 2, click on
"Reconcile"
The entries are created twice, no check is performed to verify that the
statement line is already reconciled.
opw-741824
| -rw-r--r-- | addons/account/i18n/account.pot | 6 | ||||
| -rw-r--r-- | addons/account/models/account_bank_statement.py | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 7d04aa32e6d..a5336193698 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -850,6 +850,12 @@ msgid "A selected move line was already reconciled." msgstr "" #. module: account +#: code:addons/account/models/account_bank_statement.py:883 +#, python-format +msgid "A selected statement line was already reconciled with an account move." +msgstr "" + +#. module: account #: code:addons/account/models/account_bank_statement.py:218 #, python-format msgid "A statement cannot be canceled when its lines are reconciled." diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 8e424aff77b..157fdbedf4a 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -879,6 +879,8 @@ class AccountBankStatementLine(models.Model): if aml_dict.get('tax_ids') and aml_dict['tax_ids'] and isinstance(aml_dict['tax_ids'][0], (int, long)): # Transform the value in the format required for One2many and Many2many fields aml_dict['tax_ids'] = map(lambda id: (4, id, None), aml_dict['tax_ids']) + if any(line.journal_entry_ids for line in self): + raise UserError(_('A selected statement line was already reconciled with an account move.')) # Fully reconciled moves are just linked to the bank statement total = self.amount |
