Skip to content

Commit

Permalink
[IMP] account_reconcile_oca: move remaining amount to suspense accoun…
Browse files Browse the repository at this point in the history
…t when marking partially paid invoice as fully paid
  • Loading branch information
ByteMeAsap committed Sep 30, 2024
1 parent e11c081 commit 5b57e0f
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,34 +827,13 @@ def button_manual_reference_full_paid(self):
reconcile_auxiliary_id = self.reconcile_data_info["reconcile_auxiliary_id"]
for line in data:
if line["reference"] == manual_reference and line.get("id"):
total_amount = -line["amount"] + line["original_amount_unsigned"]
original_amount = line["original_amount_unsigned"]
reconcile_auxiliary_id, lines = self._get_reconcile_line(
self.env["account.move.line"].browse(line["id"]),
"other",
is_counterpart=True,
reconcile_auxiliary_id=reconcile_auxiliary_id,
max_amount=original_amount,
max_amount=line["original_amount_unsigned"],
)
new_data += lines
new_data.append(
{
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
"id": False,
"account_id": line["account_id"],
"partner_id": line.get("partner_id"),
"date": line["date"],
"name": line["name"],
"amount": -total_amount,
"credit": total_amount if total_amount > 0 else 0.0,
"debit": -total_amount if total_amount < 0 else 0.0,
"kind": "other",
"currency_id": line["currency_id"],
"line_currency_id": line["currency_id"],
"currency_amount": -total_amount,
}
)
reconcile_auxiliary_id += 1
else:
new_data.append(line)
self.reconcile_data_info = self._recompute_suspense_line(
Expand Down

0 comments on commit 5b57e0f

Please sign in to comment.