-
Notifications
You must be signed in to change notification settings - Fork 23.5k
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
Viewtiverse Avengers: add required field (invisible) automatically in views #137031
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
094fef2
to
08e3c7f
Compare
ee4f054
to
79ecace
Compare
1a0ad6f
to
e76dee0
Compare
Gorash
added a commit
to odoo/documentation
that referenced
this pull request
Oct 12, 2023
4fd7794
to
e57b9e7
Compare
Gorash
added a commit
to odoo-dev/odoo
that referenced
this pull request
Apr 18, 2024
Since odoo#137031 the invisible fields are add automatically (invisible and readonly) if they are used by python expressions in views (invisible, required, readonly, context, domain...). The mandatory invisible field must be commented just after the field tag. The comment must indicate what is the technical requirement to be present. The goal is to clean all views, improve the comprehention of the addons and remove dead code. Task-3482092 Task-3864056
This was referenced Apr 18, 2024
robodoo
pushed a commit
that referenced
this pull request
Apr 25, 2024
Since #137031 the invisible fields are add automatically (invisible and readonly) if they are used by python expressions in views (invisible, required, readonly, context, domain...). The mandatory invisible field must be commented just after the field tag. The comment must indicate what is the technical requirement to be present. The goal is to clean all views, improve the comprehention of the addons and remove dead code. Task-3482092 Task-3864056 closes #162009 Related: odoo/upgrade#5923 Related: odoo/enterprise#60811 Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
hubvd
added a commit
to odoo-dev/odoo
that referenced
this pull request
Jun 11, 2024
Steps to reproduce ================== - Website > Configuration > Payment Providers - Enable a payment provider, and it will be published by default - Save your changes - Observed behavior: the status of the payment provider is Unpublished, even - though it is published on the website - When disabling the payment provider, the status will be changes to Published - If you try to unpublish it, you'll get the message You cannot publish a disabled provider - Expected behavior: it should be automatically published when enabled, and - automatically unpublished when disabled. At the moment, the behavior from the - front-end is okay, but the status of the publish button is wrong. Cause of the issue ================== Changes applied to readonly fields are not saved https://github.com/odoo/odoo/blob/4f325ef620263c27e095eb49026a677ac617a0ee/addons/web/static/src/model/relational_model/record.js#L623-L630 Since odoo#137031 , the field has been removed from the view. It is now considered readonly. Solution ======== Add the field back to the view opw-3908473
hubvd
added a commit
to odoo-dev/odoo
that referenced
this pull request
Jun 11, 2024
Steps to reproduce ================== - Website > Configuration > Payment Providers - Enable a payment provider, and it will be published by default - Save your changes - Observed behavior: the status of the payment provider is Unpublished, even - though it is published on the website - When disabling the payment provider, the status will be changes to Published - If you try to unpublish it, you'll get the message You cannot publish a disabled provider - Expected behavior: it should be automatically published when enabled, and - automatically unpublished when disabled. At the moment, the behavior from the - front-end is okay, but the status of the publish button is wrong. Cause of the issue ================== Changes applied to readonly fields are not saved https://github.com/odoo/odoo/blob/4f325ef620263c27e095eb49026a677ac617a0ee/addons/web/static/src/model/relational_model/record.js#L623-L630 Since odoo#137031 , the field has been removed from the view. It is now considered readonly. Solution ======== Add the field back to the view opw-3908473
robodoo
pushed a commit
that referenced
this pull request
Jun 11, 2024
Steps to reproduce ================== - Website > Configuration > Payment Providers - Enable a payment provider, and it will be published by default - Save your changes - Observed behavior: the status of the payment provider is Unpublished, even - though it is published on the website - When disabling the payment provider, the status will be changes to Published - If you try to unpublish it, you'll get the message You cannot publish a disabled provider - Expected behavior: it should be automatically published when enabled, and - automatically unpublished when disabled. At the moment, the behavior from the - front-end is okay, but the status of the publish button is wrong. Cause of the issue ================== Changes applied to readonly fields are not saved https://github.com/odoo/odoo/blob/4f325ef620263c27e095eb49026a677ac617a0ee/addons/web/static/src/model/relational_model/record.js#L623-L630 Since #137031 , the field has been removed from the view. It is now considered readonly. Solution ======== Add the field back to the view opw-3908473 closes #168851 Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
fw-bot
pushed a commit
to odoo-dev/odoo
that referenced
this pull request
Jun 11, 2024
Steps to reproduce ================== - Website > Configuration > Payment Providers - Enable a payment provider, and it will be published by default - Save your changes - Observed behavior: the status of the payment provider is Unpublished, even - though it is published on the website - When disabling the payment provider, the status will be changes to Published - If you try to unpublish it, you'll get the message You cannot publish a disabled provider - Expected behavior: it should be automatically published when enabled, and - automatically unpublished when disabled. At the moment, the behavior from the - front-end is okay, but the status of the publish button is wrong. Cause of the issue ================== Changes applied to readonly fields are not saved https://github.com/odoo/odoo/blob/4f325ef620263c27e095eb49026a677ac617a0ee/addons/web/static/src/model/relational_model/record.js#L623-L630 Since odoo#137031 , the field has been removed from the view. It is now considered readonly. Solution ======== Add the field back to the view opw-3908473 X-original-commit: 08f6307
robodoo
pushed a commit
that referenced
this pull request
Jun 12, 2024
Steps to reproduce ================== - Website > Configuration > Payment Providers - Enable a payment provider, and it will be published by default - Save your changes - Observed behavior: the status of the payment provider is Unpublished, even - though it is published on the website - When disabling the payment provider, the status will be changes to Published - If you try to unpublish it, you'll get the message You cannot publish a disabled provider - Expected behavior: it should be automatically published when enabled, and - automatically unpublished when disabled. At the moment, the behavior from the - front-end is okay, but the status of the publish button is wrong. Cause of the issue ================== Changes applied to readonly fields are not saved https://github.com/odoo/odoo/blob/4f325ef620263c27e095eb49026a677ac617a0ee/addons/web/static/src/model/relational_model/record.js#L623-L630 Since #137031 , the field has been removed from the view. It is now considered readonly. Solution ======== Add the field back to the view opw-3908473 closes #168966 X-original-commit: 08f6307 Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
abya-odoo
pushed a commit
to odoo-dev/odoo
that referenced
this pull request
Jul 1, 2024
Steps to reproduce ================== - Website > Configuration > Payment Providers - Enable a payment provider, and it will be published by default - Save your changes - Observed behavior: the status of the payment provider is Unpublished, even - though it is published on the website - When disabling the payment provider, the status will be changes to Published - If you try to unpublish it, you'll get the message You cannot publish a disabled provider - Expected behavior: it should be automatically published when enabled, and - automatically unpublished when disabled. At the moment, the behavior from the - front-end is okay, but the status of the publish button is wrong. Cause of the issue ================== Changes applied to readonly fields are not saved https://github.com/odoo/odoo/blob/4f325ef620263c27e095eb49026a677ac617a0ee/addons/web/static/src/model/relational_model/record.js#L623-L630 Since odoo#137031 , the field has been removed from the view. It is now considered readonly. Solution ======== Add the field back to the view opw-3908473 closes odoo#168966 X-original-commit: 08f6307 Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
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.
[IMP] base: required field (from view python expr) are add automatically
Goal:
Fields are added if they appear in python expressions (invisible,
column_invisible, readonly, required, context, domain). Added fields are
invisible and readonly. Some invisible fields are necessary in views for
other reasons such as onchanges.
This commit adds the feature and some examples of view simplification
(removal of invisible fields) and fixes views with bad groups.
Before this commit:
View validation performed a match between the combination of groups on the
required fields and the combination of groups on the fields where they
were used. Validation was only done for groups in xml views and did not
take care of restrictions on the model or fields.
After this commit:
Validation checks if the fields exist on the model and if the groups on
the fields match the combination of groups or values are used.
During post-processing, required fields are added as needed in the view
(cached) as invisible and readonly. These have all the groups for which
it might be required.
Task: Viewtiverse Avengers
task-3414068
task-3482092