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_move_template: Post-install test + fallback to load CoA #2044

Merged
merged 1 commit into from
Mar 6, 2025
Merged
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 @@ -2,13 +2,23 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import Command
from odoo.exceptions import UserError, ValidationError
from odoo.tests.common import Form, TransactionCase
from odoo.tests.common import Form, TransactionCase, tagged


@tagged("-at_install", "post_install")
class TestAccountMoveTemplateEnhanced(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
if not cls.env.company.chart_template_id:
# Load a CoA if there's none in current company
coa = cls.env.ref("l10n_generic_coa.configurable_chart_template", False)

Check warning on line 15 in account_move_template/tests/test_account_move_template_options.py

View check run for this annotation

Codecov / codecov/patch

account_move_template/tests/test_account_move_template_options.py#L15

Added line #L15 was not covered by tests
if not coa:
# Load the first available CoA
coa = cls.env["account.chart.template"].search(

Check warning on line 18 in account_move_template/tests/test_account_move_template_options.py

View check run for this annotation

Codecov / codecov/patch

account_move_template/tests/test_account_move_template_options.py#L18

Added line #L18 was not covered by tests
[("visible", "=", True)], limit=1
)
coa.try_loading(company=cls.env.company, install_demo=False)

Check warning on line 21 in account_move_template/tests/test_account_move_template_options.py

View check run for this annotation

Codecov / codecov/patch

account_move_template/tests/test_account_move_template_options.py#L21

Added line #L21 was not covered by tests
cls.Move = cls.env["account.move"]
cls.Journal = cls.env["account.journal"]
cls.Account = cls.env["account.account"]
Expand Down