[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
Open
Conversation
…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>
Contributor
|
Hi @alexis-via, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
For the
1line_no_productinvoice line method, the global adjustment line(generated by
_prepare_global_adjustment_linewhen the parsed untaxed amountdiffers from the sum of the lines) was created without an account: the
method only set
account_idfrom the import config fornline_no_product.Like
nline_no_product, a1line_no_productimport config stores the accountdirectly (
account_id), so both methods should resolve the adjustment-lineaccount from
import_config["account"].Fix
Handle
1line_no_producttogether withnline_no_productin_prepare_global_adjustment_line.Tests
Added coverage for the account resolution of
_prepare_global_adjustment_linefor every
invoice_line_method: config account (1line_no_product/nline_no_product), product expense account (nline_static_product), companyadjustment debit/credit account by sign (
nline_auto_product), and themissing-account
UserError.