-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
[16.0] cms_form: migrate to v16 #130
Merged
Merged
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
**Attributes become fields** All attributes that configure a form are now odoo fields. Fields that are just for configuration/behavior (meaning that shouldn't be consider in form rendering) must have the flag `form_tech=True`. Default configuration can be set by overriding fields' defaults. For instance, to declare the model:: form_model_name = fields.Char(default="res.partner") or to declare which fields to use:: form_model_fields = Serialized(default=("name", "country_id")) Same story for widgets. **Fields lookup API change** `form_fields()` and `form_fieldsets()` are not available anymore. You must use `form.form_fields_get()` and `form.form_fieldsets_get`.
When the transaction is rolled back due to an pg error use a new env to be able to inject the status message otherwise a dead request will be used.
You can now use form_widget={...} field attribute to provide your own widget for the form.
Centralize lookup for attributes via private api
Allows forms to customize the html name of each widget. Very handy in case you want to combine multiple forms together.
Transform inputs to list of dict values
To proxy and ease customization of final html value
Do not load any default for main wizard model. Only step models need preloaded data.
Hide the whole field block. Fixes 2 issues: * ensure field tech name matches * hide the whole block, not just the input
Handy method to load all steps values at once and merge them.
Original keys should be popped when transformed
Rework file processing so that files come ready from request data.
It's useless to reload defaults when they are already loaded in form_data or overridden by specific values passed for form_data at form_init.
The field wrapper should toggle the required class.
/ocabot merge minor |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at be08868. Thanks a lot for contributing to OCA. ❤️ |
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.
Depends on:
Most important changes:
Attributes become fields
All attributes that configure a form are now odoo fields.
Fields that are just for configuration/behavior
(meaning that shouldn't be consider in form rendering)
must have the flag
form_tech=True
.Default configuration can be set by overriding fields' defaults.
For instance, to declare the model::
or to declare which fields to use::
Same story for widgets.
Fields lookup API change
form_fields()
andform_fieldsets()
are not available anymore.You must use
form.form_fields_get()
andform.form_fieldsets_get
.TODO: