Skip to content

Commit

Permalink
Merge pull request #1436 from OCA/14.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/web (14.0)
  • Loading branch information
bt-admin authored Feb 7, 2025
2 parents a467424 + d1c0da4 commit 6be8e9c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ addon | version | maintainers | summary
[web_ir_actions_act_view_reload](web_ir_actions_act_view_reload/) | 14.0.1.0.2 | | Enables reload of the current view via ActionManager
[web_ir_actions_act_window_message](web_ir_actions_act_window_message/) | 14.0.1.0.1 | | Show a message box to users
[web_listview_range_select](web_listview_range_select/) | 14.0.1.0.0 | | Enables selecting a range of records using the shift key
[web_m2x_options](web_m2x_options/) | 14.0.1.1.2 | | web_m2x_options
[web_m2x_options](web_m2x_options/) | 14.0.1.2.0 | | web_m2x_options
[web_m2x_options_manager](web_m2x_options_manager/) | 14.0.1.2.0 | | Adds an interface to manage the "Create" and "Create and Edit" options for specific models and fields.
[web_no_bubble](web_no_bubble/) | 14.0.1.1.0 | | Remove the bubbles from the web interface
[web_notify](web_notify/) | 14.0.1.1.0 | | Send notification messages to user
Expand Down
7 changes: 6 additions & 1 deletion web_m2x_options/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ web_m2x_options
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1f28c92cd5c1a43185c582e5aa670e47dc78efced048df3c27bf0e77a0b1ad0d
!! source digest: sha256:8f7b94cc4cb20c4dcd6fcb714a71323a6d140e5850034e301f34e57e9e0531e8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -92,6 +92,10 @@ in the field's options dict

Deactivates the color picker on many2many_tags buttons to do nothing (ignored if open is set)

``ignore_m2x_options`` *boolean* (Default: ``False``)

The field will be processed without following the implementation of this module.

ir.config_parameter options
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -189,6 +193,7 @@ Contributors
* Carlos Roca
* Bhavesh Odedra <[email protected]>
* Dhara Solanki <[email protected]> (http://www.initos.com)
* Alexandre D. Díaz <[email protected]>

Maintainers
~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion web_m2x_options/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
"name": "web_m2x_options",
"version": "14.0.1.1.2",
"version": "14.0.1.2.0",
"category": "Web",
"author": "initOS GmbH,"
"ACSONE SA/NV, "
Expand Down
1 change: 1 addition & 0 deletions web_m2x_options/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
* Carlos Roca
* Bhavesh Odedra <[email protected]>
* Dhara Solanki <[email protected]> (http://www.initos.com)
* Alexandre D. Díaz <[email protected]>
4 changes: 4 additions & 0 deletions web_m2x_options/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ in the field's options dict

Deactivates the color picker on many2many_tags buttons to do nothing (ignored if open is set)

``ignore_m2x_options`` *boolean* (Default: ``False``)

The field will be processed without following the implementation of this module.

ir.config_parameter options
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
29 changes: 23 additions & 6 deletions web_m2x_options/static/src/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {

FieldMany2One.include({
_onInputFocusout: function () {
if (this.nodeOptions.ignore_m2x_options) {
return this._super(...arguments);
}

var m2o_dialog_opt =
is_option_set(this.nodeOptions.m2o_dialog) ||
(_.isUndefined(this.nodeOptions.m2o_dialog) &&
Expand All @@ -112,6 +116,10 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
_search: function (search_val) {
var self = this;

if (self.nodeOptions.ignore_m2x_options) {
return this._super(...arguments);
}

var def = new Promise((resolve) => {
// Add options limit used to change number of selections record
// returned.
Expand All @@ -127,10 +135,7 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
self.field_color = self.nodeOptions.field_color;
self.colors = self.nodeOptions.colors;

const context = Object.assign(
self.record.getContext(self.recordParams),
self.additionalContext
);
var context = self.record.getContext(self.recordParams);
var domain = self.record.getDomain(self.recordParams);

var blacklisted_ids = self._getSearchBlacklist();
Expand Down Expand Up @@ -375,6 +380,10 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
}),

_onDeleteTag: function (event) {
if (this.nodeOptions.ignore_m2x_options) {
return this._super(...arguments);
}

var result = this._super.apply(this, arguments);
event.stopPropagation();
return result;
Expand All @@ -383,7 +392,7 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
_onOpenBadge: function (event) {
var self = this;
var open = self.nodeOptions && is_option_set(self.nodeOptions.open);
if (open) {
if (!self.nodeOptions.ignore_m2x_options && open) {
var context = self.record.getContext(self.recordParams);
var id = parseInt($(event.currentTarget).data("id"), 10);

Expand Down Expand Up @@ -442,7 +451,11 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
_onOpenRecord: function (ev) {
var self = this;
var open = this.nodeOptions.open;
if (open && self.mode === "readonly") {
if (
!this.nodeOptions.ignore_m2x_options &&
open &&
self.mode === "readonly"
) {
ev.stopPropagation();
var id = ev.data.id;
var res_id = self.record.data[self.name].data.filter(
Expand All @@ -467,6 +480,10 @@ odoo.define("web_m2x_options.web_m2x_options", function (require) {
}),

_onOpenBadge: function (event) {
if (this.nodeOptions.ignore_m2x_options) {
return this._super(...arguments);
}

var open = is_option_set(this.nodeOptions.open);
var no_color_picker = is_option_set(this.nodeOptions.no_color_picker);
this._super.apply(this, arguments);
Expand Down

0 comments on commit 6be8e9c

Please sign in to comment.