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] purchase_discount: Post-install test + fallback to load CoA #2579

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

pedrobaeza
Copy link
Member

Since odoo/odoo@d0342c8, the default existing company is not getting a CoA automatically, provoking than the current tests fail with error:

odoo.exceptions.UserError: No journal could be found in company My Company (San Francisco) for any of those types: purchase

provoked by the lack of a CoA installed.

Thus, we put tests post-install for being sure localization modules are installed, the same as AccountTestInvoicingCommon does, but we don't inherit from it, as it creates an overhead creating 2 new companies and loading their CoA, and some more stuff, while we don't need all of that.

Besides, if you don't have l10n_generic_coa installed, you can't use another CoA (like l10n_es) easily, so we put little code to select the first available CoA.

@Tecnativa

@pedrobaeza pedrobaeza added this to the 16.0 milestone Feb 24, 2025
@pedrobaeza pedrobaeza force-pushed the 16.0-fix-purchase_discount-coa branch from d831e19 to b7914f7 Compare February 24, 2025 20:10
@pedrobaeza
Copy link
Member Author

Tested on integration tests and working:

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-2579-by-pedrobaeza-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Feb 25, 2025
Signed-off-by pedrobaeza
@OCA-git-bot
Copy link
Contributor

@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-2579-by-pedrobaeza-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

… assert almost

Since odoo/odoo@d0342c8, the default existing company is not getting a
CoA automatically, provoking than the current tests fail with error:

odoo.exceptions.UserError: No journal could be found in company My Company (San Francisco) for any of those types: purchase

provoked by the lack of a CoA installed.

Thus, we put tests post-install for being sure localization modules are
installed, the same as AccountTestInvoicingCommon does, but we don't
inherit from it, as it creates an overhead creating 2 new companies and
loading their CoA, and some more stuff, while we don't need all of that.

Besides, if you don't have `l10n_generic_coa` installed, you can't use
another CoA (like `l10n_es`) easily, so we put little code to select the
first available CoA.

It also includes a change on the assert for avoiding rounding issues
discovered while testing this one.
@pedrobaeza pedrobaeza force-pushed the 16.0-fix-purchase_discount-coa branch from b7914f7 to 6263d45 Compare February 25, 2025 08:30
@pedrobaeza
Copy link
Member Author

@legalsylvain the error is very weird with purchase_triple_discount and I'm not able to reproduce it locally. Do you know what's going on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants