[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
This commit is contained in:
Nicolas Martinelli
2017-05-08 15:37:25 +02:00
parent ee6e2f5771
commit 8d9f0c8d94
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -849,6 +849,12 @@ msgstr ""
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
@@ -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