8000 [18.0][FIX] web_m2x_options: prevent crash on Many2OneReferenceField by sbejaoui · Pull Request #3191 · OCA/web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[18.0][FIX] web_m2x_options: prevent crash on Many2OneReferenceField #3191

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

Merged
merged 1 commit into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 32 additions & 27 deletions web_m2x_options/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ create rights)
To add these parameters go to Configuration -> Technical -> Parameters
-> System Parameters and add new parameters like:

- web_m2x_options.create: False
- web_m2x_options.create_edit: False
- web_m2x_options.limit: 10
- web_m2x_options.search_more: True
- web_m2x_options.field_limit_entries: 5
- web_m2x_options.create: False
- web_m2x_options.create_edit: False
- web_m2x_options.limit: 10
- web_m2x_options.search_more: True
- web_m2x_options.field_limit_entries: 5

Example
-------
Expand All @@ -131,9 +131,10 @@ set on a field ! If nothing works, add a debugger in the first line of
something in a many2one field, javascript debugger should pause. If not
verify your installation.

- Instead of making the tags rectangle clickable, I think it's better to
put the text as a clickable link, so we will get a consistent
behaviour/aspect with other clickable elements (many2one...).
- Instead of making the tags rectangle clickable, I think it's better
to put the text as a clickable link, so we will get a consistent
behaviour/aspect with other clickable elements (many2one...).
- Properly support web_m2x_options on Many2OneReferenceField.

Bug Tracker
===========
Expand All @@ -160,38 +161,42 @@ Authors
Contributors
------------

- David Coninckx <davconinckx@gmail.com>
- David Coninckx <davconinckx@gmail.com>

- Emanuel Cino <ecino@compassion.ch>
- Emanuel Cino <ecino@compassion.ch>

- Holger Brunn <hbrunn@therp.nl>
- Holger Brunn <hbrunn@therp.nl>

- Nicolas JEUDY <nicolas@sudokeys.com>
- Nicolas JEUDY <nicolas@sudokeys.com>

- Yannick Vaucher <yannick.vaucher@camptocamp.com>
- Yannick Vaucher <yannick.vaucher@camptocamp.com>

- Zakaria Makrelouf <z.makrelouf@gmail.com>
- Zakaria Makrelouf <z.makrelouf@gmail.com>

- `Tecnativa <https://www.tecnativa.com>`__:
- `Tecnativa <https://www.tecnativa.com>`__:

- Jairo Llopis <jairo.llopis@tecnativa.com>
- David Vidal <david.vidal@tecnativa.com>
- Ernesto Tejeda <ernesto.tejeda87@gmail.com>
- Carlos Roca
- Jairo Llopis <jairo.llopis@tecnativa.com>
- David Vidal <david.vidal@tecnativa.com>
- Ernesto Tejeda <ernesto.tejeda87@gmail.com>
- Carlos Roca

- Bhavesh Odedra <bodedra@opensourceintegrators.com>
- Bhavesh Odedra <bodedra@opensourceintegrators.com>

- Dhara Solanki <dhara.solanki@initos.com> (http://www.initos.com)
- Dhara Solanki <dhara.solanki@initos.com> (http://www.initos.com)

- `Trobz <https://trobz.com>`__:
- `Trobz <https://trobz.com>`__:

- Hoang Diep <hoang@trobz.com>
- Hoang Diep <hoang@trobz.com>

- `Sygel <https://sygel.es>`__:
- `Sygel <https://sygel.es>`__:

- Manuel Regidor <manuel.regidor@sygel.es>
- Valentín Vinagre <valentin.vinagre@sygel.es>
- Harald Panten <harald.panten@sygel.es>
- Manuel Regidor <manuel.regidor@sygel.es>
- Valentín Vinagre <valentin.vinagre@sygel.es>
- Harald Panten <harald.panten@sygel.es>

- `ACSONE SA/NV <https://acsone.eu>`__:

- Souheil BEJAOUI <souheil.bejaoui@acsone.eu>

Other credits
-------------
Expand Down
3 changes: 3 additions & 0 deletions web_m2x_options/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
- Manuel Regidor \<<manuel.regidor@sygel.es>\>
- Valentín Vinagre \<<valentin.vinagre@sygel.es>\>
- Harald Panten \<<harald.panten@sygel.es>\>

- [ACSONE SA/NV](https://acsone.eu):
- Souheil BEJAOUI \<<souheil.bejaoui@acsone.eu>\>
1 change: 1 addition & 0 deletions web_m2x_options/readme/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ your installation.
- Instead of making the tags rectangle clickable, I think it's better to
put the text as a clickable link, so we will get a consistent
behaviour/aspect with other clickable elements (many2one...).
- Properly support web_m2x_options on Many2OneReferenceField.
9 changes: 7 additions & 2 deletions web_m2x_options/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,10 @@ <h1><a class="toc-backref" href="#toc-entry-5">Known issues / Roadmap</a></h1>
something in a many2one field, javascript debugger should pause. If not
verify your installation.</p>
<ul class="simple">
<li>Instead of making the tags rectangle clickable, I think it’s better to
put the text as a clickable link, so we will get a consistent
<li>Instead of making the tags rectangle clickable, I think it’s better
to put the text as a clickable link, so we will get a consistent
behaviour/aspect with other clickable elements (many2one…).</li>
<li>Properly support web_m2x_options on Many2OneReferenceField.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
Expand Down Expand Up @@ -525,6 +526,10 @@ <h2><a class="toc-backref" href="#toc-entry-9">Contributors</a></h2>
<li>Harald Panten &lt;<a class="reference external" href="mailto:harald.panten&#64;sygel.es">harald.panten&#64;sygel.es</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://acsone.eu">ACSONE SA/NV</a>:<ul>
<li>Souheil BEJAOUI &lt;<a class="reference external" href="mailto:souheil.bejaoui&#64;acsone.eu">souheil.bejaoui&#64;acsone.eu</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
Expand Down
11 changes: 11 additions & 0 deletions web_m2x_options/static/src/components/form.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Many2XAutocomplete,
} from "@web/views/fields/relational_utils";
import {Many2OneField, many2OneField} from "@web/views/fields/many2one/many2one_field";
import {Many2OneReferenceField} from "@web/views/fields/many2one_reference/many2one_reference_field";
import {FormController} from "@web/views/form/form_controller";
import {evaluateBooleanExpr} from "@web/core/py_js/py";
import {fieldColorProps} from "../views/fields/standard_field_props.esm";
Expand Down Expand Up @@ -116,6 +117,16 @@ patch(many2OneField, {
},
});

// FIXME: Many2OneReferenceField does not support m2o_options_props.
// This no-op prevents crashes, but proper option support is still missing.
// See roadmap note in PR #3191
patch(Many2OneReferenceField, {
// eslint-disable-next-line no-unused-vars
m2o_options_props(props, attrs, options) {
return props;
},
});

patch(Many2OneField.prototype, {
get Many2XAutocompleteProps() {
const search_limit = this.props.searchLimit;
Expand Down
0