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.0][FIX] account_invoice_report_due_list: Define the right rate for the currency in test #356

Draft
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from odoo import fields
from odoo.tests import common, tagged
from odoo.tests.common import Form
from odoo.tools import posix_to_ldml, pycompat
from odoo.tools import mute_logger, posix_to_ldml, pycompat


@tagged("post_install", "-at_install")
Expand Down Expand Up @@ -108,7 +108,19 @@ def test_due_list(self, move_type="out_invoice"):
self.assertRegex(str(res[0]), date_due_format)
self.assertRegex(str(res[0]), "75.0")

@mute_logger("odoo.models.unlink")
def test_due_list_currency_extra(self, move_type="out_invoice"):
# We leave the rate of the extra currency at 1 so that the amounts to be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# We leave the rate of the extra currency at 1 so that the amounts to be
# We leave the rate of the extra currency at 2 so that the amounts to be

# checked are as expected.
self.env["res.currency.rate"].search(
[("currency_id", "=", self.currency_extra.id)]
).unlink()
self.env["res.currency.rate"].create(
{
"currency_id": self.currency_extra.id,
"rate": 2,
}
)
move_form2 = Form(
self.env["account.move"].with_context(default_move_type=move_type)
)
Expand All @@ -120,4 +132,4 @@ def test_due_list_currency_extra(self, move_type="out_invoice"):
line_form2.price_unit = 200.0
invoice2 = move_form2.save()
invoice2.action_post()
self.assertEqual(invoice2.get_multi_due_list()[0][2], 50.0)
self.assertEqual(invoice2.get_multi_due_list()[0][2], 25.0)
Loading