-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] core: DatabaseObject replaces _sql_constraints #11071
Closed
Closed
Conversation
This file contains 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
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
2 times, most recently
from
September 24, 2024 01:59
ce2df4e
to
92c9d1c
Compare
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
4 times, most recently
from
October 11, 2024 08:03
346a051
to
e12c47d
Compare
ryv-odoo
reviewed
Oct 16, 2024
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
from
October 17, 2024 09:28
e12c47d
to
b1985ee
Compare
C3POdoo
requested review from
a team and
HydrionBurst
and removed request for
a team
October 17, 2024 09:31
Feyensv
reviewed
Oct 17, 2024
AntoineVDV
requested changes
Oct 17, 2024
AntoineVDV
approved these changes
Oct 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robodoo delegate+
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
2 times, most recently
from
October 18, 2024 11:17
6795a40
to
9b7ef93
Compare
kmagusiak
changed the title
[IMP] core: SQLObject replaces _sql_constraints
[IMP] core: DatabaseObject replaces _sql_constraints
Oct 18, 2024
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
3 times, most recently
from
October 24, 2024 08:06
637d6ac
to
7547432
Compare
@robodoo r+ |
@kmagusiak linked pull request(s) odoo/enterprise#68589, odoo/odoo#175783 not ready. Linked PRs are not staged until all of them are ready. |
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
from
October 25, 2024 06:55
7547432
to
dd1eb38
Compare
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
from
October 29, 2024 09:49
dd1eb38
to
97b46d5
Compare
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
from
November 5, 2024 11:26
97b46d5
to
c42cb92
Compare
task-3390431
kmagusiak
force-pushed
the
master-sql-constraints-object-krma
branch
from
November 7, 2024 13:37
c42cb92
to
e9c7b77
Compare
@robodoo r+ |
@kmagusiak you may want to rebuild or fix this PR as it has failed CI. |
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Nov 8, 2024
Edition of the constraints is not reflected in the database. The only thing you can do is to remove them and set the message. Part-of: #175783 Related: odoo/enterprise#68589 Related: odoo/documentation#11071 Signed-off-by: Raphael Collet <[email protected]>
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Nov 8, 2024
Introducting `models.Constraint` that will replace `_sql_constraints`. We make the message extensible since you ow have access to the diagnostics and can make them dynamic. The messages between the web interface and the imports are also aligned. Constraints are generalized as TableObjects and can be declared directly on the model. This way we allow for future subclassing. This way you can specify constraints and indexes easily: _some_check = models.Constraint("CHECK(a > 1)") task-3390431 Part-of: #175783 Related: odoo/enterprise#68589 Related: odoo/documentation#11071 Signed-off-by: Raphael Collet <[email protected]>
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Nov 8, 2024
We should not parse the definition of the constraint. Therefore, let's handle all constraints in the same way. Note that we do not define manually FOREIGN KEYS, so we can just remove this code and add a new class in the future if we need to handle it differently. Part-of: #175783 Related: odoo/enterprise#68589 Related: odoo/documentation#11071 Signed-off-by: Raphael Collet <[email protected]>
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Nov 8, 2024
Introducting models.Index and UniqueIndex that can be declared in models. There is no longer a need for virtual constraints (which are always implemented using an index). _partner_idx = models.Index('(partner_id, res_model)') _name_uniq = models.UniqueIndex('(name) WHERE active IS TRUE') task-3390431 Part-of: #175783 Related: odoo/enterprise#68589 Related: odoo/documentation#11071 Signed-off-by: Raphael Collet <[email protected]>
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Nov 8, 2024
Part-of: #175783 Related: odoo/enterprise#68589 Related: odoo/documentation#11071 Signed-off-by: Raphael Collet <[email protected]>
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Nov 8, 2024
Part-of: #175783 Related: odoo/enterprise#68589 Related: odoo/documentation#11071 Signed-off-by: Raphael Collet <[email protected]>
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Nov 8, 2024
Part-of: #175783 Related: odoo/enterprise#68589 Related: odoo/documentation#11071 Signed-off-by: Raphael Collet <[email protected]>
robodoo
pushed a commit
to odoo/odoo
that referenced
this pull request
Nov 8, 2024
Since we have a migration code for `_sql_constraints`, remove support for it and warn when used. closes #175783 Related: odoo/enterprise#68589 Related: odoo/documentation#11071 Signed-off-by: Raphael Collet <[email protected]>
robodoo
pushed a commit
that referenced
this pull request
Nov 8, 2024
task-3390431 closes #11071 Related: odoo/odoo#175783 Related: odoo/enterprise#68589 Signed-off-by: Krzysztof Magusiak (krma) <[email protected]>
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.
task-3390431
odoo/odoo#175783