Skip to content

Commit

Permalink
[IMP] account_reconcile_oca: Improve multicurrency management
Browse files Browse the repository at this point in the history
  • Loading branch information
etobella committed Sep 13, 2024
1 parent 6adc750 commit 3db40d1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ def _recompute_suspense_line(self, data, reconcile_auxiliary_id, manual_referenc
total_amount, precision_digits=self.currency_id.decimal_places
):
can_reconcile = False
currency_amount = self.company_id.currency_id._convert(
total_amount, self.currency_id, self.company_id, self.date
)
if suspense_line:
suspense_line.update(
{
Expand All @@ -246,6 +249,7 @@ def _recompute_suspense_line(self, data, reconcile_auxiliary_id, manual_referenc
}
)
else:

suspense_line = {
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
"id": False,
Expand All @@ -260,8 +264,8 @@ def _recompute_suspense_line(self, data, reconcile_auxiliary_id, manual_referenc
"debit": -total_amount if total_amount < 0 else 0.0,
"kind": "suspense",
"currency_id": self.company_id.currency_id.id,
"line_currency_id": self.company_id.currency_id.id,
"currency_amount": -total_amount,
"line_currency_id": self.currency_id.id,
"currency_amount": -currency_amount,
}
reconcile_auxiliary_id += 1
new_data.append(suspense_line)
Expand Down Expand Up @@ -723,6 +727,8 @@ def _reconcile_move_line_vals(self, line, move_id=False):
"partner_id": line.get("partner_id") and line["partner_id"][0],
"credit": line["credit"],
"debit": line["debit"],
"currency_id": line.get("line_currency_id", self.company_id.currency_id.id),
"amount_currency": line.get("currency_amount", 0.0),
"tax_ids": line.get("tax_ids", []),
"tax_tag_ids": line.get("tax_tag_ids", []),
"group_tax_id": line.get("group_tax_id"),
Expand Down

0 comments on commit 3db40d1

Please sign in to comment.