web mailing list archives

web@odoo-community.org

Avatar

Re: [OCA/web] [14.0][ADD] web list view general buttons (#1846)

by "Alexandre Díaz" <notifications@github.com> - 30/07/2021 21:52:24

@Tardo requested changes on this pull request.

Nice! some suggestions...


In web_list_view_general_buttons/__init__.py:

> @@ -0,0 +1,2 @@

+# ©  2018 Terrabit

⬇️ Suggested change
-# ©  2018 Terrabit

+# Copyright 2018 Terrabit


In web_list_view_general_buttons/__manifest__.py:

> @@ -0,0 +1,17 @@

+# ©  2018 Terrabit

⬇️ Suggested change
-# ©  2018 Terrabit

+# Copyright 2018 Terrabit


In web_list_view_general_buttons/readme/USAGE.rst:

> +

+

+

+

🔥

⬇️ Suggested change
-

-

-

-


In web_list_view_general_buttons/static/src/js/list_controller.js:

> +            var self = this;

+            if (this.context.general_buttons === "get_general_buttons") {

+                this._rpc({

+                    model: this.modelName,

+                    method: "get_general_buttons",

+                    args: [this.context.active_id],

+                    context: this.context,

+                }).then(function (result) {

+                    self.headerGeneralButtons = result;

+                });

+            }

⬇️ Suggested change
-            var self = this;

-            if (this.context.general_buttons === "get_general_buttons") {

-                this._rpc({

-                    model: this.modelName,

-                    method: "get_general_buttons",

-                    args: [this.context.active_id],

-                    context: this.context,

-                }).then(function (result) {

-                    self.headerGeneralButtons = result;

-                });

-            }

+            if (this.context.general_buttons === "get_general_buttons") {

+                this._rpc({

+                    model: this.modelName,

+                    method: "get_general_buttons",

+                    args: [this.context.active_id],

+                    context: this.context,

+                }).then((result) => {

+                    this.headerGeneralButtons = result;

+                });

+            }


In web_list_view_general_buttons/static/src/js/list_controller.js:

> +            var el = event.target;

+            var self = this;

+            self._rpc({

+                model: $(el).attr("model"),

+                method: $(el).attr("action"),

+                args: [self.context.active_id],

+                context: self.context,

+            }).then(function (result) {

+                return self.do_action(result);

+            });

⬇️ Suggested change
-            var el = event.target;

-            var self = this;

-            self._rpc({

-                model: $(el).attr("model"),

-                method: $(el).attr("action"),

-                args: [self.context.active_id],

-                context: self.context,

-            }).then(function (result) {

-                return self.do_action(result);

-            });

+            const $el = $(event.target);

+            self._rpc({

+                model: $el.attr("model"),

+                method: $el.attr("action"),

+                args: [this.context.active_id],

+                context: this.context,

+            }).then((result) => this.do_action(result));


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.