From 67341a8cef901b3ea80d622dbe757d344e330ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Thu, 26 Apr 2012 13:26:55 +0200 Subject: [PATCH] Add test button bzr revid: fva@openerp.com-20120426112655-s6j7qt098ptecwwf --- addons/point_of_sale/static/src/js/pos_widgets.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/addons/point_of_sale/static/src/js/pos_widgets.js b/addons/point_of_sale/static/src/js/pos_widgets.js index 625a423919a..870ce206ee8 100644 --- a/addons/point_of_sale/static/src/js/pos_widgets.js +++ b/addons/point_of_sale/static/src/js/pos_widgets.js @@ -570,11 +570,17 @@ function openerp_pos_widgets(module, instance){ //module is instance.point_of_sa this._super(parent, options); this.label = options.label || 'button'; this.rightalign = options.rightalign || false; + this.click_action = options.click; if(options.icon){ this.icon = options.icon; this.template = 'pos-action-button-with-icon'; } }, + start: function(){ + if(this.click_action){ + this.$element.click(_.bind(this.click_action, this)); + } + }, }); module.ActionbarWidget = instance.web.Widget.extend({ @@ -940,6 +946,15 @@ function openerp_pos_widgets(module, instance){ //module is instance.point_of_sa this.onscreenKeyboard.appendTo($(".point-of-sale #content")); this.barcodeReader = new module.BarcodeReader({'pos': self.pos }); + + this.actionBar = new module.ActionbarWidget(null); + this.actionBar.appendTo($(".point-of-sale #content")); + this.actionBar.addNewButton('left',{ + label : 'Hello World', + icon : '/point_of_sale/static/src/img/icons/png48/face-monkey.png', + click : function(){ console.log("Hello World!"); } + }); + }, createNewOrder: function() { var newOrder;