Skip to content
Snippets Groups Projects
Commit 7a030f61 authored by Adrien Widart's avatar Adrien Widart
Browse files

[FIX] {mrp_,}account,sale_{stock,mrp}: display lots in invoice


When invoicing a tracked product, the lots/SN delivered (or the related
quantities) are not always the correct ones displayed on the printed
invoice

To reproduce the issues:
1. In Settings, enable "Display Lots & Serial Numbers on Invoices"
2. Create a product P:
    - Storable
    - Tracked by lot
3. Update its quantity > 5 with lot L

Use case 01:

4. Create and confirm a SO with 5 x P
5. Process the delivery
6. Create an invoice
7. Edit the invoice line:
    - Quantity: 1
8. Post and print the invoice
Error: The quantity related to lot L is 5, it should be 1

Use case 02:

4. Edit P:
    - Invoicing Policy: Ordered quantities
5. Create and confirm a SO with 1 x P
6. Create and post the invoice
7. Process the delivery
8. Print the invoice
Error: There isn't any information about delivered lot L

Use case 03:

4. Create and confirm a SO with 3 x P
5. Deliver 1 x P (with backorder)
6. Invoice 1 x P + Post the invoice (-> INV01)
7. Deliver 2 x P
8. Reset, post INV01 again and print it
Error: The quantity related to L is 3, it should be 1. Moreover, if the
user then invoices the 2 others P, posts and prints this second invoice,
it won't contain any information about L

OPW-2730270
closes #81444

closes odoo/odoo#85115

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
Co-authored-by: default avatarAdrien Widart <awt@odoo.com>
Co-authored-by: default avatarFlorent de Labarre <florent.mirieu@gmail.com>
parent 07f3a9a8
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment