Module
account_invoice_report_grouped_by_picking
Describe the bug
When printing a customer refund generated from an invoice involving multiple delivery pickings and partial returns, the Grouped by Picking report may omit one or more pickings. This causes some invoice lines to be grouped incorrectly or displayed "Without reference".
To Reproduce
Affected versions:
Steps to reproduce the behavior:
- Create a Sales Order with several stockable products.
- Validate multiple deliveries for the same Sales Order.
- Create a partial return for one or more products.
- Create and post the customer invoice.
- Create a full refund (Credit Note) from the original invoice and print.
Expected behavior
The report should preserve all the original delivery and return pickings. Each invoice line should be grouped under the corresponding delivery or return picking. No picking should disappear from the report and no product related to a partial return should be lost.
Additional context
After debugging lines_grouped_by_picking(), we observed that the issue seems to be related to how the method reconstructs the relationship between invoice lines and stock moves when a refund is created from an invoice involving multiple deliveries and partial returns.
As a consequence, the report may lose one or more original pickings, resulting in incorrect grouping of invoice lines.
We are still investigating the exact root cause and will open a PR with the proposed fix once it has been fully validated.
Module
account_invoice_report_grouped_by_picking
Describe the bug
When printing a customer refund generated from an invoice involving multiple delivery pickings and partial returns, the Grouped by Picking report may omit one or more pickings. This causes some invoice lines to be grouped incorrectly or displayed "Without reference".
To Reproduce
Affected versions:
Steps to reproduce the behavior:
Expected behavior
The report should preserve all the original delivery and return pickings. Each invoice line should be grouped under the corresponding delivery or return picking. No picking should disappear from the report and no product related to a partial return should be lost.
Additional context
After debugging
lines_grouped_by_picking(), we observed that the issue seems to be related to how the method reconstructs the relationship between invoice lines and stock moves when a refund is created from an invoice involving multiple deliveries and partial returns.As a consequence, the report may lose one or more original pickings, resulting in incorrect grouping of invoice lines.
We are still investigating the exact root cause and will open a PR with the proposed fix once it has been fully validated.