Skip to content

[17.0] contract: last_date_invoiced on contract.line is miscalculated except on the first line #1448

Description

@Jasmina-elp

Module

contract

Describe the bug

When I create a contract with recurring_invoicing_type = 'post-paid' with multiple lines, last_date_invoiced is miscalculated except on the first line.

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Create a contract
  2. Set recurring_rule_type = 'quaterly'
  3. Set recurring_invoicing_type = 'post-paid'
  4. Set date_start = 2026-06-09
  5. Create 3 contract.line
  6. Set reccuring_next_date = 2026-06-30
  7. Save the contract
  8. Click on Create invoices button

Expected behavior
The last_date_invoiced on the first contrcat.line = 2026-06-29 while on the second and third is 2026-09-29.
I expected the last_date_invoiced = 2026-06-29 on the three lines.

Additional context
Linux
Python 3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions