Skip to content

[19.0][FIX] account_invoice_margin_sale: fix test setup for 19.0 - #293

Open
dreispt wants to merge 1 commit into
OCA:19.0from
dreispt:fix-margin-sale-test-19.0
Open

dreispt wants to merge 1 commit into
OCA:19.0from
dreispt:fix-margin-sale-test-19.0

Conversation

@dreispt

@dreispt dreispt commented Nov 17, 2026

Copy link
Copy Markdown
Member

Summary

  • account_invoice_margin_sale tests failed on fresh databases (e.g. Odoo.sh test builds) because no chart of accounts is installed when at-install tests run: invoice lines were created with account_id = NULL, violating account_move_line_check_accountable_required_fields.
  • setUpClass now creates an income account, sets it as the company income account and the sale journal default account, so invoice and down-payment lines resolve an account.

Test plan

  • account_invoice_margin_sale tests pass on a fresh database with no chart of accounts (11 tests run, 0 failures/errors locally via odoo-bin -i --test-enable)
  • pre-commit passes

Assisted-by: Devin:SWE-2 Flash

Invoice lines get no account when no chart of accounts is installed,
which is the case for at-install tests on a fresh database (e.g.
Odoo.sh test builds). Give the company an income account and the
sale journal a default account so lines resolve one.

Assisted-by: Devin:SWE-2 Flash
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @carlosdauden, @sergio-teruel,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:19.0 mod:account_invoice_margin_sale Module account_invoice_margin_sale labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:account_invoice_margin_sale Module account_invoice_margin_sale series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants