Skip to content

[16.0][FIX] contract: remove circular dependency on recurring_next_date#1462

Open
maisim wants to merge 1 commit into
OCA:16.0from
maisim:16.0-fix-rnd-circular-dependency
Open

[16.0][FIX] contract: remove circular dependency on recurring_next_date#1462
maisim wants to merge 1 commit into
OCA:16.0from
maisim:16.0-fix-rnd-circular-dependency

Conversation

@maisim

@maisim maisim commented Jun 12, 2026

Copy link
Copy Markdown

Break the cascade that overwrites user-edited recurring_next_date on contract lines whenever the contract was saved.

Three changes (aligned with the 18.0 logic):

  1. abstract_contract_line: remove contract_id.recurring_next_date from @api.depends of _compute_recurring_next_date. Only contract_id.line_recurrence remains.

  2. contract_line: remove _compute_next_period_date_start override that had cross-line dependencies (contract_id.last_date_invoiced, contract_id.contract_line_ids.last_date_invoiced).

  3. contract_line: make date_end a plain (non-computed) field and remove _compute_date_end, breaking the cascade: contract.date_end -> line.date_end -> npds -> rnd.

Add regression tests.

Fixes #1411

@Honeyxilia Honeyxilia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Live testing OK (as a technical user)
Just a remark about a change

Comment thread contract/models/abstract_contract_line.py Outdated
@maisim maisim force-pushed the 16.0-fix-rnd-circular-dependency branch from e6f1eed to a93ae4f Compare June 13, 2026 05:36
Break the cascade that overwrites user-edited recurring_next_date
on contract lines whenever the contract was saved.

Three changes (aligned with the 18.0 logic):

1. abstract_contract_line: remove contract_id.recurring_next_date
   from @api.depends of _compute_recurring_next_date. Only
   contract_id.line_recurrence remains.

2. contract_line: remove _compute_next_period_date_start override
   that had cross-line dependencies (contract_id.last_date_invoiced,
   contract_id.contract_line_ids.last_date_invoiced).

3. contract_line: make date_end a plain (non-computed) field and
   remove _compute_date_end, breaking the cascade:
   contract.date_end -> line.date_end -> npds -> rnd.

Add regression tests.
@maisim maisim force-pushed the 16.0-fix-rnd-circular-dependency branch from a93ae4f to 62d826b Compare June 13, 2026 05:42

@fcayre fcayre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review + live test ok, thanks !

@Honeyxilia Honeyxilia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review + Live test OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants