Skip to content

[16.0] contract: Editing recurring_next_date on a modal contract.line view resets the value when saving #1411

@Honeyxilia

Description

@Honeyxilia

Module

contract

Describe the bug

Whenever I go on a contract.contract form view, for a contract with line recurrence which was already invoiced (last_date_invoiced set), I try to open one line in a modal view, to modify its recurring_next_date and to Save it.
However, upon closing, the recurring_next_date value of the line is reset to the next_period_date_start value.

I'm not exactly sure why it doesn't save the recurring_next_date value on the contract.line record when clicking Save - perhaps since the Edit mode is still on, it doesn't save the value in the database, however it gets overwritten anyways.

To Reproduce

Affected versions: 16.0 (afaik)

Steps to reproduce the behavior:

  1. Create a contract.contract entity from a form view
  2. Check "Line recurrence"
  3. Create a contract.line with an arbitrary product
  4. Set a date_start before today, to set the next_period_date_start and recurring_next_date fields
  5. Save and exit
  6. Click on the newly created contract.line
  7. Set the recurring_next_date to a later date
  8. Click on Save

Expected behavior
I would like for the recurring_next_date value to not get overwritten and reset back to the next_period_date_start value

Additional context
I've found various workarounds, however they're not handy for reasons :

  • I can go on a dedicated tab to display the contract.line form view, edit the recurring_next_date value and save, and this value doesn't get overwritten - however, since no web menu allows browsing through contract.line entities, it requires knowing the ID of the contract.line and setting it in the URL bar, which is not handy for functionnal users

  • I can install the contract_update_last_invoice_date module, and set the value through the wizard (since it directly saves on the contract.line record) and quit the modal view without clicking on Save.
    However, this is an unstable solution, since modifying the recurring_next_date field directly through the modal view after can reset the recurring_next_date field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions