Repository navigation
[19.0][FIX] web_m2x_options: let field options override the system parameters - #3784
Open
CristhianAC wants to merge 1 commit into
Open
CristhianAC wants to merge 1 commit into
CristhianAC wants to merge 1 commit into
Conversation
Since the create, create_edit and open system parameters are enforced on the shared Many2One component, a field can no longer enable an option that the system parameter disables, e.g. no_create_edit: False. Enforce them in Field.fieldComponentProps instead, which knows the field options, and skip them when the field sets no_quick_create, no_create_edit or no_open. Widgets with their own extractProps keep getting the system parameters.
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.
Fixes #3776
Since #3559, the
create,create_editandopensystem parameters are enforced on the sharedMany2Onecomponent. That component does not know the field options, so a field can no longer enable an option the system parameter disables: withweb_m2x_options.create_editset toFalse,options="{'no_create_edit': False}"still hides "Create and edit...", and the field shows "No records" when nothing matches.This moves the check to
Field.fieldComponentProps, which sees both the extracted props and the field options. It still applies to widgets with their ownextractProps(e.g. the order line product field from #3550), and it is skipped when the field options setno_quick_create,no_create_editorno_open.Also fixes the usage doc, which described a
create: Trueoption the module does not read.Hoot tests cover the system parameters, the field overrides and a widget with its own
extractProps. The two override tests fail without the fix.@FrandyDLaCruz the option the module reads is
no_create_edit: False;create_edit: Trueis not supported.