Skip to content

[14.0][FIX] account_invoice_import: set account on global adjustment line for 1line_no_product#1364

Open
klodr wants to merge 1 commit into
OCA:14.0from
klodr:14.0-fix-account_invoice_import-1line_no_product
Open

[14.0][FIX] account_invoice_import: set account on global adjustment line for 1line_no_product#1364
klodr wants to merge 1 commit into
OCA:14.0from
klodr:14.0-fix-account_invoice_import-1line_no_product

Conversation

@klodr

@klodr klodr commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Issue

For the 1line_no_product invoice line method, the global adjustment line
(generated by _prepare_global_adjustment_line when the parsed untaxed amount
differs from the sum of the lines) was created without an account: the
method only set account_id from the import config for nline_no_product.

Like nline_no_product, a 1line_no_product import config stores the account
directly (account_id), so both methods should resolve the adjustment-line
account from import_config["account"].

Fix

Handle 1line_no_product together with nline_no_product in
_prepare_global_adjustment_line.

Tests

Added coverage for the account resolution of _prepare_global_adjustment_line
for every invoice_line_method: config account (1line_no_product /
nline_no_product), product expense account (nline_static_product), company
adjustment debit/credit account by sign (nline_auto_product), and the
missing-account UserError.

…t line for 1line_no_product

_prepare_global_adjustment_line only set account_id from the import config
for the 'nline_no_product' method. With '1line_no_product' (which also stores
the account directly on the import config), the global adjustment line -
created when the parsed untaxed amount differs from the sum of the lines -
was left without an account. Handle both methods the same way.

Add tests covering the account resolution of _prepare_global_adjustment_line
for every invoice_line_method (config account, product account, company
adjustment debit/credit account, and the missing-account error).

Signed-off-by: Claude Perrin <klodr@users.noreply.github.com>
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @alexis-via,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added mod:account_invoice_import Module account_invoice_import series:14.0 labels Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:account_invoice_import Module account_invoice_import series:14.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants