Skip to content

Commit

Permalink
account_move_line_reconcile_manual : Add test to cover case of multip…
Browse files Browse the repository at this point in the history
…le currencies reconciliation
  • Loading branch information
florian-dacosta committed Oct 9, 2023
1 parent af345e3 commit ea3d5e5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions account_move_line_reconcile_manual/tests/test_reconcile_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,29 @@ def test_foreign_currency_reconcile_with_write_off(self):

self.assertTrue(self.line1.full_reconcile_id)
self.assertEqual(self.line1.full_reconcile_id, self.line2.full_reconcile_id)

def test_multi_currency_full_reconcile(self):
self.move1 = self._generate_debit_reconcile_move(65.41, currency_amount=100)
self.line1 = self.move1.line_ids.filtered(
lambda x: x.account_id == self.rec_account
)
self.move2 = self._generate_credit_reconcile_move(30)
self.line2 = self.move2.line_ids.filtered(
lambda x: x.account_id == self.rec_account
)
lines_to_rec = self.line1 + self.line2
wiz = (
self.env["account.move.line.reconcile.manual"]
.with_context(active_model="account.move.line", active_ids=lines_to_rec.ids)
.create({})
)
self.assertEqual(wiz.writeoff_type, "expense")
wiz.go_to_writeoff()
wiz.write(
{
"writeoff_journal_id": self.journal.id,
"writeoff_ref": self.writeoff_ref,
"writeoff_account_id": self.writeoff_account.id,
}
)
wiz.reconcile_with_writeoff()

0 comments on commit ea3d5e5

Please sign in to comment.