Skip to content

[19.0][FIX] web_m2x_options: let field options override the system parameters - #3784

Open
CristhianAC wants to merge 1 commit into
OCA:19.0from
CristhianAC:19.0-fix-web_m2x_options-field-override-cag
Open

CristhianAC wants to merge 1 commit into
OCA:19.0from
CristhianAC:19.0-fix-web_m2x_options-field-override-cag

Conversation

@CristhianAC

Copy link
Copy Markdown

Fixes #3776

Since #3559, the create, create_edit and open system parameters are enforced on the shared Many2One component. That component does not know the field options, so a field can no longer enable an option the system parameter disables: with web_m2x_options.create_edit set to False, 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 own extractProps (e.g. the order line product field from #3550), and it is skipped when the field options set no_quick_create, no_create_edit or no_open.

Also fixes the usage doc, which described a create: True option 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: True is not supported.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[19.0] web_m2x_options: system parameter + m2o options not working properly when no records

2 participants