Skip to content
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] orm : add info about boolean default #6933

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from

Conversation

asno-odoo
Copy link

When a default value for boolean is set as False, the values of new column for existing records is set to NULL. In python, FALSE and NULL might mean same thing in certain contexts but its not the case for Sql(we allow to add sql constraints).

concerned code: https://github.com/odoo/odoo/blob/15.0/odoo/models.py#L2767

When a default value for boolean is set as False, the values of
new column for existing records is set to NULL. In python, FALSE
and NULL might mean same thing in certain contexts but its not the
case for Sql(we allow to add sql constraints).
@robodoo
Copy link
Collaborator

robodoo commented Dec 14, 2023

@asno-odoo asno-odoo requested a review from a team December 14, 2023 16:15
@C3POdoo C3POdoo requested a review from a team December 14, 2023 16:23
@AntoineVDV AntoineVDV removed the request for review from a team December 18, 2023 14:29
Copy link
Collaborator

@AntoineVDV AntoineVDV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi again,

Adding this note here makes very little sense; readers are just being introduced to the concept of fields and didn't learn about default values yet, even less about SQL constraints. In fact, I believe that this note shouldn't be included in a general-purpose tutorial at all.

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