Skip to content

[18.0][FIX] subscription_oca: correct the recurring_next_date #1491

Open
rrjorgegz wants to merge 1 commit into
OCA:18.0from
rrjorgegz:18.0-fix-calculate_recurring_next_date-if-change-template_id
Open

[18.0][FIX] subscription_oca: correct the recurring_next_date #1491
rrjorgegz wants to merge 1 commit into
OCA:18.0from
rrjorgegz:18.0-fix-calculate_recurring_next_date-if-change-template_id

Conversation

@rrjorgegz

Copy link
Copy Markdown

[FIX] subscription_oca: correct the recurring_next_date when the subscription has paid invoices and change the template_id

…cription has paid invoices and change the template_id
Copilot AI review requested due to automatic review settings July 25, 2026 15:46

Copilot AI 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.

Pull request overview

This PR adjusts how recurring_next_date is recalculated when a subscription’s template is changed and the subscription already has invoices, aiming to base the next date on invoicing history rather than the provided start date.

Changes:

  • Update calculate_recurring_next_date() to derive the next billing date from the latest (currently: posted) invoice date.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +221 to +222
inv_posted = self.invoice_ids.filtered(lambda ss: ss.state == "posted")
start_date = max(inv_posted.mapped("invoice_date"))
Comment on lines +221 to +222
inv_posted = self.invoice_ids.filtered(lambda ss: ss.state == "posted")
start_date = max(inv_posted.mapped("invoice_date"))
@rrjorgegz rrjorgegz closed this Jul 25, 2026
@rrjorgegz
rrjorgegz deleted the 18.0-fix-calculate_recurring_next_date-if-change-template_id branch July 25, 2026 17:20
@rrjorgegz
rrjorgegz restored the 18.0-fix-calculate_recurring_next_date-if-change-template_id branch July 25, 2026 17:21
@rrjorgegz rrjorgegz reopened this Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants