Conversation
…e_id field on product.template model
This was referenced Mar 24, 2026
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.
Context
We discovered this issue during a customer migration from v14 to v18: the
subscription_template_idfield value for product templates is lost after upgrading to v18.Root Cause
#1060 made
subscription_template_ida company-dependent field onproduct.template, but this change was never forward-ported beyond its target version (v14).In Odoo 18.0, company-dependent fields are stored in a JSONB column instead of
ir_propertyrecords. Since the forward-port never happened, the automatic migration fromir_propertyto JSONB did not occur, leaving the field empty after upgrade.Solution
This pull request adds a pre-migration script for Odoo 18.0 that backfills
product_template.subscription_template_idfrom legacyir_propertyrecords, ensuring existing data is preserved during the upgrade.Scope
This fix applies in a way that only instances affected by the company-dependent implementation of the
subscription_template_idfield will be targeted. Nothing changes or backfires if you're not affected.Migration and Data Integrity
pre-migration.pyto backfillproduct_template.subscription_template_idfrom legacyir_propertyrecords