[16.0][BUG] contract: 'last_date_invoiced' is not calculating correctly on the lines.
Module
contract
Describe the bug
The field last_date_invoiced is not computing correctly.
To Reproduce
Affected versions: 16.0
Steps to reproduce the behavior:
- We create a contract with 2 lines
- We set the start date a 1/1/24 and a recurrence of every 1 week, with the invoing type as pre-paid.
- We generate an invoice. First error.
- Copy the existing contract, add 2 lines and generate an invoice. Second error
First error
If we look, the Date of Next Invoice is set correctly at 8/1/24.
The 'Last Date Invoiced' on the first line is correctly set at 7/1/24, but on the second line is set at 14/1/24.
Second error
If we copy the previous contract and we add 2 more lines, when we generate the first Invoice, the field 'Last Date Invoiced' of the copied lines is not set and the lines aren't added at the invoice.
Expected behavior The expected behaviour on the first error should be setting on all the lines the same 'Last Date Invoiced' because the recurrence is set in a global level and not in a line leve.
Additional context Add any other context about the problem here. (e.g. OS, Python version, ...)