Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16][FIX] account_reconcile_oca : Wrong amount currency compute in case of change in liquidity line #787

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,11 @@ def _get_manual_reconcile_vals(self):
"debit": self.manual_amount if self.manual_amount > 0 else 0.0,
"analytic_distribution": self.analytic_distribution,
}
if self.manual_line_id:
liquidity_lines, _suspense_lines, _other_lines = self._seek_for_lines()
if self.manual_line_id and self.manual_line_id.id not in liquidity_lines.ids:
vals.update(
{
"currency_amount": self.manual_line_id.currency_id._convert(
"currency_amount": self.manual_currency_id._convert(
self.manual_amount,
self.manual_in_currency_id,
self.company_id,
Expand Down
3 changes: 3 additions & 0 deletions account_reconcile_oca/tests/test_bank_account_reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,10 @@ def test_invoice_foreign_currency_late_change_of_rate(self):
)
f.manual_reference = "account.move.line;%s" % line["id"]
# simulate click on statement line, check amount does not recompute
f.manual_partner_id = inv1.partner_id
self.assertEqual(f.manual_amount, 83.33)
# check currency amount is still fine
self.assertEqual(f.reconcile_data_info["data"][0]["currency_amount"], 100)
f.add_account_move_line_id = inv1.line_ids.filtered(
lambda l: l.account_id.account_type == "asset_receivable"
)
Expand Down
Loading