diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 4cf53f2fac3..fd1d1f69584 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -211,26 +211,6 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa barcode_error_action: function(code){ this.pos_widget.screen_selector.show_popup('error-barcode',code.code); }, - // shows an action bar on the screen. The actionbar is automatically shown when you add a button - // with add_action_button() - show_action_bar: function(){ - this.pos_widget.action_bar.show(); - }, - - // hides the action bar. The actionbar is automatically hidden when it is empty - hide_action_bar: function(){ - this.pos_widget.action_bar.hide(); - }, - - // adds a new button to the action bar. The button definition takes three parameters, all optional : - // - label: the text below the button - // - icon: a small icon that will be shown - // - click: a callback that will be executed when the button is clicked. - // the method returns a reference to the button widget, and automatically show the actionbar. - add_action_button: function(button_def){ - this.show_action_bar(); - return this.pos_widget.action_bar.add_new_button(button_def); - }, // this method shows the screen and sets up all the widget related to this screen. Extend this method // if you want to alter the behavior of the screen. @@ -242,12 +222,6 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this.$el.removeClass('oe_hidden'); } - if(this.pos_widget.action_bar.get_button_count() > 0){ - this.show_action_bar(); - }else{ - this.hide_action_bar(); - } - var self = this; this.pos_widget.set_numpad_visible(this.show_numpad); @@ -270,7 +244,6 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa if(this.pos.barcode_reader){ this.pos.barcode_reader.reset_action_callbacks(); } - this.pos_widget.action_bar.destroy_buttons(); }, // this methods hides the screen. It's not a good place to put your cleanup stuff as it is called on the diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 33b421b9090..b5db7ee47e1 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -293,90 +293,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa }, }); - module.ActionButtonWidget = instance.web.Widget.extend({ - template:'ActionButtonWidget', - icon_template:'ActionButtonWidgetWithIcon', - init: function(parent, options){ - this._super(parent, options); - this.label = options.label || 'button'; - this.rightalign = options.rightalign || false; - this.click_action = options.click; - this.disabled = options.disabled || false; - if(options.icon){ - this.icon = options.icon; - this.template = this.icon_template; - } - }, - set_disabled: function(disabled){ - if(this.disabled != disabled){ - this.disabled = !!disabled; - this.renderElement(); - } - }, - renderElement: function(){ - this._super(); - if(this.click_action && !this.disabled){ - this.$el.click(_.bind(this.click_action, this)); - } - }, - }); - - module.ActionBarWidget = instance.web.Widget.extend({ - template:'ActionBarWidget', - init: function(parent, options){ - this._super(parent,options); - this.button_list = []; - this.buttons = {}; - this.visibility = {}; - }, - set_element_visible: function(element, visible, action){ - if(visible != this.visibility[element]){ - this.visibility[element] = !!visible; - if(visible){ - this.$('.'+element).removeClass('oe_hidden'); - }else{ - this.$('.'+element).addClass('oe_hidden'); - } - } - if(visible && action){ - this.action[element] = action; - this.$('.'+element).off('click').click(action); - } - }, - set_button_disabled: function(name, disabled){ - var b = this.buttons[name]; - if(b){ - b.set_disabled(disabled); - } - }, - destroy_buttons:function(){ - for(var i = 0; i < this.button_list.length; i++){ - this.button_list[i].destroy(); - } - this.button_list = []; - this.buttons = {}; - return this; - }, - get_button_count: function(){ - return this.button_list.length; - }, - add_new_button: function(button_options){ - var button = new module.ActionButtonWidget(this,button_options); - this.button_list.push(button); - if(button_options.name){ - this.buttons[button_options.name] = button; - } - button.appendTo(this.$('.pos-actionbar-button-list')); - return button; - }, - show:function(){ - this.$el.removeClass('oe_hidden'); - }, - hide:function(){ - this.$el.addClass('oe_hidden'); - }, - }); - module.ProductCategoriesWidget = module.PosBaseWidget.extend({ template: 'ProductCategoriesWidget', init: function(parent, options){ @@ -891,7 +807,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa // - a header, containing the list of orders // - a leftpane, containing the list of bought products (orderlines) // - a rightpane, containing the screens (see pos_screens.js) - // - an actionbar on the bottom, containing various action buttons // - popups // - an onscreen keyboard // a screen_selector which controls the switching between screens and the showing/closing of popups @@ -1125,9 +1040,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.username = new module.UsernameWidget(this,{}); this.username.replace(this.$('.placeholder-UsernameWidget')); - this.action_bar = new module.ActionBarWidget(this); - this.action_bar.replace(this.$(".placeholder-RightActionBar")); - this.actionpad = new module.ActionpadWidget(this, {}); this.actionpad.replace(this.$('.placeholder-ActionpadWidget')); diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index e2fdc392a40..77dea42c5db 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -42,13 +42,6 @@ -