From fcde32d1802bc1458e0f7ee315caf3463e89f808 Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Thu, 25 Sep 2014 11:48:56 +0200 Subject: [PATCH] [IMP] point_of_sale: new textinput popup Conflicts: addons/point_of_sale/static/src/js/screens.js addons/point_of_sale/static/src/js/widgets.js --- addons/point_of_sale/static/src/css/pos.css | 10 +++++- addons/point_of_sale/static/src/js/screens.js | 32 +++++++++++++++++++ addons/point_of_sale/static/src/js/widgets.js | 4 +++ addons/point_of_sale/static/src/xml/pos.xml | 17 ++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 26c2bfbaa66..5688e134023 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -1911,7 +1911,15 @@ td { height: 180px; line-height:180px; } - +.pos .popup input { + font-size: 18px; + font-family: Lato; + padding: 4px; + border-radius: 3px; + border: solid 1px #cecece; + box-sizing: border-box; + width: 80%; +} /* ********* The Webkit Scrollbar ********* */ .pos *::-webkit-scrollbar{ diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 56f538a4cd6..5971c340863 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -378,6 +378,38 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }, }); + module.TextInputPopupWidget = module.PopUpWidget.extend({ + template: 'TextInputPopupWidget', + show: function(options){ + var self = this; + this._super(); + + this.message = options.message || ''; + this.comment = options.comment || ''; + this.value = options.value || ''; + this.renderElement(); + + this.$('.button.cancel').click(function(){ + self.pos_widget.screen_selector.close_popup(); + if( options.cancel ){ + options.cancel.call(self); + } + }); + + this.$('.button.confirm').click(function(){ + self.pos_widget.screen_selector.close_popup(); + var value = self.$('input').val(); + if( options.confirm ){ + options.confirm.call(self,value); + } + }); + }, + }); + + module.ErrorNoClientPopupWidget = module.ErrorPopupWidget.extend({ + template: 'ErrorNoClientPopupWidget', + }); + module.ErrorInvoiceTransferPopupWidget = module.ErrorPopupWidget.extend({ template: 'ErrorInvoiceTransferPopupWidget', }); diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 54960345fc9..b74014cb1f6 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -1010,6 +1010,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.fullscreen_popup = new module.FullscreenPopup(this,{}); this.fullscreen_popup.appendTo(this.$el); + this.textinput_popup = new module.TextInputPopupWidget(this,{}); + this.textinput_popup.appendTo(this.$el); + this.unsent_orders_popup = new module.UnsentOrdersPopupWidget(this,{}); this.unsent_orders_popup.appendTo(this.$el); @@ -1076,6 +1079,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa 'error': this.error_popup, 'error-barcode': this.error_barcode_popup, 'error-traceback': this.error_traceback_popup, + 'textinput': this.textinput_popup, 'confirm': this.confirm_popup, 'fullscreen': this.fullscreen_popup, 'unsent-orders': this.unsent_orders_popup, diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 21d3fcb78c1..85f6badec96 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -919,6 +919,23 @@ + + + +