[FIX] account_reconciliation_widget: Don't suggest own journal items

When getting propositions from the reconcile models, we should
explicitly exclude the amls of the bank statement lines.

If not, we can get a situation where the journal item of the bank
statement line is proposed to itself.

TT45568
This commit is contained in:
Pedro M. Baeza
2023-10-22 12:23:55 +02:00
parent 2a1171d9c5
commit ba9809fa9b

View File

@@ -332,7 +332,10 @@ class AccountReconciliation(models.AbstractModel):
domain += srch_domain domain += srch_domain
bank_statement_lines = self.env["account.bank.statement.line"].search(domain) bank_statement_lines = self.env["account.bank.statement.line"].search(domain)
results = self.get_bank_statement_line_data(bank_statement_lines.ids) results = self.get_bank_statement_line_data(
bank_statement_lines.ids,
excluded_ids=bank_statement_lines.move_id.line_ids.ids,
)
bank_statement_lines_left = self.env["account.bank.statement.line"].browse( bank_statement_lines_left = self.env["account.bank.statement.line"].browse(
[line["st_line"]["id"] for line in results["lines"]] [line["st_line"]["id"] for line in results["lines"]]
) )