Skip to content

Conversation

@jeremi
Copy link
Member

@jeremi jeremi commented Nov 30, 2025

Migrate deprecated _sql_constraints to model.Constraint decorators to resolve Odoo 19 deprecation warnings.

This PR introduces migrate_sql_constraints.py (a regex-based script) and run_fix_sql_constraints.sh (a wrapper) to automate the conversion of _sql_constraints in Odoo addon modules. It also includes FIX_SQL_CONSTRAINTS.md for detailed usage and troubleshooting. The scripts handle UNIQUE constraints automatically and flag CHECK constraints for manual review, ensuring compatibility with Odoo 19's new constraint definition.


Open in Cursor Open in Web

Co-authored-by: jeremi <jeremi@acn.fr>
@cursor
Copy link

cursor bot commented Nov 30, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
17 Security Hotspots

See analysis details on SonarQube Cloud

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants