Skip to content
Snippets Groups Projects
Commit 23a18bc1 authored by Touati Djamel (otd)'s avatar Touati Djamel (otd)
Browse files

[FIX] l10n_it_stock_ddt: calculate link between invoice and deliveries


Steps to reproduce the bug:
- Install [l10n_it_ddt]
- Create a storable product “P1”
- Create a SO for “P1” with qty 3
- Deliver 1 unit and create a backorder
- Generate the invoice for the delivered qty: 1
- Post the invoice
- smart button with the link to DDT n°1 appears
- Deliver the remaining 2 units
- Create the second invoice
- Post the invoice

Problem:
The link to DDT appears but with the 2 pickings, whereas in this case
only the 2nd picking is linked to the invoice.

Before using the `account.move.line` records, we sorted them by date
in order to always use the first created one to link it with the first
picking created, however if two `account.move.line` were created in
the same days, they will be ordered randomly, so we also have to
sort them by id if the date is the same.

opw-2968401

closes odoo/odoo#100294

Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
parent 637c6d65
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment