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
CopilotAI review requested due to automatic review settings July 25, 2026 15:46

CopilotAI 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 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
@rrjorgegzrrjorgegz reopened this Jul 25, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:subscription_ocaModule subscription_ocaseries:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rrjorgegz@OCA-git-bot