diff --git a/web_widget_child_selector/static/src/js/widget_child_selector.js b/web_widget_child_selector/static/src/js/widget_child_selector.js index a3aafa00c..d81a205fa 100644 --- a/web_widget_child_selector/static/src/js/widget_child_selector.js +++ b/web_widget_child_selector/static/src/js/widget_child_selector.js @@ -1,4 +1,4 @@ -odoo.define("web.web_widget_child_selector", function(require) { +odoo.define("web.web_widget_child_selector", function (require) { "use strict"; var relational_fields = require("web.relational_fields"); @@ -12,12 +12,12 @@ odoo.define("web.web_widget_child_selector", function(require) { events: _.extend({}, FieldMany2One.prototype.events, { "click .o_child_selection_button": "_onChildSelectionClick", }), - start: function() { + start: function () { this.$input_dropdown = this.$(".o_input_dropdown"); this.$input_value = this.$(".o_input_value"); return this._super.apply(this, arguments); }, - _renderReadonly: function() { + _renderReadonly: function () { var value = _.escape((this.m2o_value || "").trim()) .split("\n") .join("
"); @@ -34,7 +34,7 @@ odoo.define("web.web_widget_child_selector", function(require) { this.$el.addClass("o_form_uri"); } }, - _set_childs: function() { + _set_childs: function () { var self = this; this.childs = {}; this.parents = {}; @@ -51,11 +51,11 @@ odoo.define("web.web_widget_child_selector", function(require) { this.record.getDomain({fieldName: this.name}), ], context: this.record.getContext(this.recordParams), - }).then(function(data) { - _.each(data.parents, function(parent, key) { + }).then(function (data) { + _.each(data.parents, function (parent, key) { self.parents[key] = parent; }); - _.each(data.childs, function(child, key) { + _.each(data.childs, function (child, key) { self.childs[key] = child; }); self.$input_dropdown.append( @@ -70,7 +70,7 @@ odoo.define("web.web_widget_child_selector", function(require) { ); }); }, - _onChildSelectionClick: function(event) { + _onChildSelectionClick: function (event) { var target = $(event.target); var type = target.data("type"); if (type === "clear") { @@ -81,7 +81,7 @@ odoo.define("web.web_widget_child_selector", function(require) { this._setValue({id: value[0], display_name: value[1]}); } }, - _renderEdit: function() { + _renderEdit: function () { this._set_childs(); }, });