Repository navigation
Conversation
The readonly hook overrides _fields_view_get, which core 17.0 no longer has, so it never runs. It also set the literal string "not is_editable_field" instead of the field name. Fields set in the config files stayed editable in forms and edits were silently lost. Backport of OCA#227. (cherry picked from commit d5dc33d)
This file contains hidden or 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
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.
Backport of #227: on 17.0, fields that server_environment reads from the config are editable in forms, and whatever you type there is lost on save.
Steps to reproduce, with
mail_environmentinstalled:smtp_host = smtp.example.comunder[outgoing_mail]in the server env config.The save goes through without any message, but the field comes back as
smtp.example.com. It should be read-only, as it is on 19.0.Two bugs in
server_env_mixin.py, fixed the same way as in #227:_fields_view_get, which core 17.0 no longer has, so it never runs_get_viewreadonlyset on the field"not is_editable_field", the literal text"not x_smtp_host_env_is_editable"Note
Other branches
19.0 already has this fix (f1f46bc). #227 for 18.0 is approved and still open.
Checks on a local 17.0 database
Config:
smtp_hostset under[outgoing_mail].smtp_hostin the mail server form arch<field name="smtp_host" required="smtp_authentication != 'cli'"/>... readonly="not x_smtp_host_env_is_editable"namestill editablewrite({"smtp_host": "typed.in.form"})then readsmtp.cfg.example