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] base,*: remove __last_update from all models #105739

Closed

Conversation

VincentSchippefilt
Copy link
Contributor

The main goal of this commit is to reduce the size of the registry by
removing the (almost) useless __last_update field.

Statistics # of fields with all modules installed:
before 30184 fields, 1299x last_update (4.30%)

Before this commit, the computed field __last_update was added on every model.
The idea behind this field was to have a computed field that had either
the write_date or the create_date if the write_date was empty. However,
the write_date is always written, even on creation, making it useless
to have the computed field __last_update

After this update, we completely remove from BaseModel:

  • __last_update
  • CONCURRENCY_CHECK_FIELD that was always defined as "__last_update"
  • _compute_concurrency_field that was the compute function for __last_update

task-id: 3062140 (part of 3062137 improve registry load time)


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Nov 15, 2022

@C3POdoo C3POdoo added the RD research & development, internal work label Nov 15, 2022
@VincentSchippefilt VincentSchippefilt force-pushed the master-remove_last_update-vsc branch 3 times, most recently from 51c2505 to 0304d64 Compare November 17, 2022 08:06
@VincentSchippefilt VincentSchippefilt marked this pull request as ready for review November 17, 2022 09:08
@C3POdoo C3POdoo requested review from a team November 17, 2022 09:10
Copy link
Member

@Julien00859 Julien00859 left a comment

Choose a reason for hiding this comment

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

LGTM

addons/website/models/website_form.py Outdated Show resolved Hide resolved
Copy link
Contributor

@tde-banana-odoo tde-banana-odoo left a comment

Choose a reason for hiding this comment

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

LGTM for mail part, thanks :)

@flvr-odoo
Copy link
Contributor

@robodoo override=ci/security
Reason:

  • No change in behaviors for the lines that were flagged by CI/security

addons/product/models/product_product.py Outdated Show resolved Hide resolved
addons/product/models/product_product.py Outdated Show resolved Hide resolved
addons/web/models/ir_qweb_fields.py Outdated Show resolved Hide resolved
odoo/addons/base/models/assetsbundle.py Outdated Show resolved Hide resolved
odoo/addons/base/models/assetsbundle.py Outdated Show resolved Hide resolved
odoo/addons/base/models/ir_ui_view.py Outdated Show resolved Hide resolved
odoo/http.py Outdated Show resolved Hide resolved
odoo/http.py Outdated Show resolved Hide resolved
@VincentSchippefilt VincentSchippefilt force-pushed the master-remove_last_update-vsc branch 4 times, most recently from f99f8a9 to d00ee49 Compare November 22, 2022 15:56
Copy link
Member

@rco-odoo rco-odoo left a comment

Choose a reason for hiding this comment

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

We're almost done. This is getting really nice!

addons/product/models/product_product.py Outdated Show resolved Hide resolved
addons/web/models/ir_qweb_fields.py Show resolved Hide resolved
addons/website/models/website.py Outdated Show resolved Hide resolved
addons/product/tests/test_variants.py Outdated Show resolved Hide resolved
addons/product/tests/test_variants.py Outdated Show resolved Hide resolved
odoo/addons/base/models/ir_ui_view.py Outdated Show resolved Hide resolved
odoo/fields.py Outdated Show resolved Hide resolved
@C3POdoo C3POdoo requested a review from a team November 30, 2022 09:11
@VincentSchippefilt VincentSchippefilt force-pushed the master-remove_last_update-vsc branch 6 times, most recently from 9d168c9 to 159f0ea Compare November 30, 2022 14:43
@C3POdoo C3POdoo requested a review from a team December 7, 2022 11:22
@VincentSchippefilt
Copy link
Contributor Author

robodoo r+

@robodoo
Copy link
Contributor

robodoo commented Dec 7, 2022

@VincentSchippefilt linked pull request(s) odoo/upgrade#4038 not ready. Linked PRs are not staged until all of them are ready.

The main goal of this commit is to reduce the size of the registry by
removing the (almost) useless __last_update field.

Statistics # of fields with all modules installed:
before 30184 fields, 1299x last_update (4.30%)

Before this commit, the computed field __last_update was added on every model.
The idea behind this field was to have a computed field that had either
the write_date or the create_date if the write_date was empty. However,
the write_date is always written, even on creation, making it useless
to have the computed field __last_update

After this update, we completely remove from BaseModel:
* __last_update
* CONCURRENCY_CHECK_FIELD that was always defined as "__last_update"
* _compute_concurrency_field that was the compute function for __last_update

task-id: 3062140 (part of 3062137 improve registry load time)
@rco-odoo rco-odoo force-pushed the master-remove_last_update-vsc branch from 7094c2f to c2f5268 Compare December 7, 2022 13:03
@rco-odoo
Copy link
Member

rco-odoo commented Dec 7, 2022

@robodoo r+

robodoo pushed a commit that referenced this pull request Dec 7, 2022
The main goal of this commit is to reduce the size of the registry by
removing the (almost) useless __last_update field.

Statistics # of fields with all modules installed:
before 30184 fields, 1299x last_update (4.30%)

Before this commit, the computed field __last_update was added on every model.
The idea behind this field was to have a computed field that had either
the write_date or the create_date if the write_date was empty. However,
the write_date is always written, even on creation, making it useless
to have the computed field __last_update

After this update, we completely remove from BaseModel:
* __last_update
* CONCURRENCY_CHECK_FIELD that was always defined as "__last_update"
* _compute_concurrency_field that was the compute function for __last_update

closes #105739

Task-id: 3062140 (part of 3062137 improve registry load time)
Related: odoo/upgrade#4038
Related: odoo/enterprise#33939
Signed-off-by: Raphael Collet <rco@odoo.com>
@robodoo robodoo temporarily deployed to merge December 7, 2022 18:30 Inactive
@robodoo robodoo closed this Dec 7, 2022
@robodoo robodoo added the 16.1 label Dec 7, 2022
@fw-bot fw-bot deleted the master-remove_last_update-vsc branch December 21, 2022 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
16.1 RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants