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] delivery_auto_refresh: Fallback to load CoA #994

Merged
merged 1 commit into from
Feb 25, 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
9 changes: 9 additions & 0 deletions delivery_auto_refresh/tests/test_delivery_auto_refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
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 22 in delivery_auto_refresh/tests/test_delivery_auto_refresh.py

View check run for this annotation

Codecov / codecov/patch

delivery_auto_refresh/tests/test_delivery_auto_refresh.py#L22

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

Check warning on line 25 in delivery_auto_refresh/tests/test_delivery_auto_refresh.py

View check run for this annotation

Codecov / codecov/patch

delivery_auto_refresh/tests/test_delivery_auto_refresh.py#L25

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

Check warning on line 28 in delivery_auto_refresh/tests/test_delivery_auto_refresh.py

View check run for this annotation

Codecov / codecov/patch

delivery_auto_refresh/tests/test_delivery_auto_refresh.py#L28

Added line #L28 was not covered by tests
cls.env.user.write(
{
"groups_id": [
Expand Down