[18.0][FIX] subscription_oca: correct the recurring_next_date #1491
Open
rrjorgegz wants to merge 1 commit into
Open
[18.0][FIX] subscription_oca: correct the recurring_next_date #1491rrjorgegz wants to merge 1 commit into
rrjorgegz wants to merge 1 commit into
Conversation
…cription has paid invoices and change the template_id
There was a problem hiding this comment.
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
deleted the
18.0-fix-calculate_recurring_next_date-if-change-template_id
branch
July 25, 2026 17:20
rrjorgegz
restored the
18.0-fix-calculate_recurring_next_date-if-change-template_id
branch
July 25, 2026 17:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[FIX] subscription_oca: correct the recurring_next_date when the subscription has paid invoices and change the template_id