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_payment_partner: Fallback to load CoA #1427

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
10 changes: 9 additions & 1 deletion account_payment_partner/tests/test_account_payment_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))

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 21 in account_payment_partner/tests/test_account_payment_partner.py

View check run for this annotation

Codecov / codecov/patch

account_payment_partner/tests/test_account_payment_partner.py#L21

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

Check warning on line 24 in account_payment_partner/tests/test_account_payment_partner.py

View check run for this annotation

Codecov / codecov/patch

account_payment_partner/tests/test_account_payment_partner.py#L24

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

Check warning on line 27 in account_payment_partner/tests/test_account_payment_partner.py

View check run for this annotation

Codecov / codecov/patch

account_payment_partner/tests/test_account_payment_partner.py#L27

Added line #L27 was not covered by tests
cls.res_users_model = cls.env["res.users"]
cls.move_model = cls.env["account.move"]
cls.journal_model = cls.env["account.journal"]
Expand Down