[19.0][FIX] account_invoice_report_grouped_by_picking: convert grouped qty to invoice line UoM - #424
Merged
OCA-git-bot merged 1 commit intoJun 25, 2026
Conversation
…to invoice line UoM lines_grouped_by_picking summed and subtracted the stock move quantity (in the move's UoM) against the invoice line quantity (in the invoice line UoM) without converting. When the invoice line UoM differs from the product's stock UoM (e.g. selling in packs/pallets while stock is in units), the per-picking quantity was printed in the stock UoM and a bogus negative remainder line was produced. _get_signed_quantity_done now converts the move quantity to the invoice line UoM. Adds a regression test.
pedrobaeza
approved these changes
Jun 24, 2026
| "name": "Account Invoice Grouped by Picking", | ||
| "summary": "Print invoice lines grouped by picking", | ||
| "version": "19.0.1.0.0", | ||
| "version": "19.0.1.0.1", |
Member
There was a problem hiding this comment.
Please don't change manually the module version. It's done on merge.
Member
|
As no conflict has arisen with the module version change, let's merge with nobump: /ocabot merge nobump |
Contributor
|
Hey, thanks for contributing! Proceeding to merge this for you. |
Contributor
|
Congratulations, your PR was merged at 6699a21. Thanks a lot for contributing to OCA. ❤️ |
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.
Bug
lines_grouped_by_pickingsums and subtracts the stock move quantity returned by_get_signed_quantity_done(expressed in the move's UoM, i.e. the product's stock UoM) againstline.quantity/remaining_qty(expressed in the invoice line UoM), without converting between the two:When the invoice line UoM differs from the product's stock UoM (e.g. selling in packs/pallets while stock is kept in units), two things go wrong:
It goes unnoticed in the common case where both UoMs are equal.
Fix
_get_signed_quantity_donenow converts the move quantity to the invoice line UoM before it is summed/subtracted. A regression test (test_account_invoice_group_picking_uom_conversion) covers a product sold per pack of 6 while delivered in units: exactly one group, expressed in packs, with no phantom remainder line.Test
account_invoice_report_grouped_by_pickingtest suite: 6/6 green.