robert2206 8 gadi atpakaļ
vecāks
revīzija
353ece49c9
1 mainītis faili ar 37 papildinājumiem un 0 dzēšanām
  1. 37 0
      static/src/js/tools.js

+ 37 - 0
static/src/js/tools.js

@@ -14,6 +14,43 @@
         }
     });
 
+    if (openerp.web && openerp.web.FormView) {
+        openerp.web.FormView.include({
+            do_show: function (options) {
+                if (options instanceof Object) {
+                    console.log(this);
+                    this.$el.find('.oe_form_sheet').prepend('<button class="oe_button oe_button_highlight">Clickme</button>');
+                }
+                return this._super.apply(this, arguments);
+            }
+        });
+    }
+
+    if (openerp.web && openerp.web.ListView) {
+        openerp.web.ListView.include({
+            do_select: function () {
+                var sidebar = this.sidebar.$el.find('.oe_sidebar');
+
+                if (this.get_selected_ids().length) {
+                    sidebar.append('<button class="oe_button oe_highlight">Clickme</button>');
+                } else {
+                    sidebar.find('.oe_button').remove();
+                }
+
+                return this._super.apply(this, arguments);
+            }
+        });
+    }
+
+    if (openerp.web && openerp.web.Sidebar) {
+        openerp.web.Sidebar.include({
+            start: function () {
+                // console.log(this);
+                return this._super.apply(this, arguments);
+            }
+        });
+    }
+
     if (openerp.web && openerp.web.WebClient) {
         openerp.web.WebClient.include({
             show_application: function () {