diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 5c8103c7626..b3ff62a7994 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -72,6 +72,7 @@ class pos_config(osv.osv): 'iface_scan_via_proxy' : fields.boolean('Scan via Proxy', help="Enable barcode scanning with a remotely connected barcode scanner"), 'iface_invoicing': fields.boolean('Invoicing',help='Enables invoice generation from the Point of Sale'), 'iface_big_scrollbars': fields.boolean('Large Scrollbars',help='For imprecise industrial touchscreens'), + 'iface_fullscreen': fields.boolean('Fullscreen', help='Display the Point of Sale in full screen mode'), 'receipt_header': fields.text('Receipt Header',help="A short text that will be inserted as a header in the printed receipt"), 'receipt_footer': fields.text('Receipt Footer',help="A short text that will be inserted as a footer in the printed receipt"), 'proxy_ip': fields.char('IP Address', help='The hostname or ip address of the hardware proxy, Will be autodetected if left empty', size=45), diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 07ec934318e..91707e648ab 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -658,6 +658,7 @@ + diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 30939636b23..b9c9605ed92 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -1663,7 +1663,7 @@ td { .pos .popup .comment{ font-weight: normal; font-size: 18px; - margin: 0px 16px; + margin: 0px 16px 16px 16px; } .pos .popup .footer{ position:absolute; diff --git a/addons/point_of_sale/static/src/img/ios-share-icon.png b/addons/point_of_sale/static/src/img/ios-share-icon.png new file mode 100644 index 00000000000..8588657e123 Binary files /dev/null and b/addons/point_of_sale/static/src/img/ios-share-icon.png differ diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 48fa00e1d70..b326a6326be 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -314,6 +314,26 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }); + module.FullscreenPopup = module.PopUpWidget.extend({ + template:'FullscreenPopupWidget', + show: function(){ + var self = this; + this._super(); + this.renderElement(); + this.$('.button.fullscreen').off('click').click(function(){ + window.document.body.webkitRequestFullscreen(); + self.pos_widget.screen_selector.close_popup(); + }); + this.$('.button.cancel').off('click').click(function(){ + self.pos_widget.screen_selector.close_popup(); + }); + }, + ismobile: function(){ + return typeof window.orientation !== 'undefined'; + } + }); + + module.ChooseReceiptPopupWidget = module.PopUpWidget.extend({ template:'ChooseReceiptPopupWidget', show: function(){ diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 5db12165737..72a6f7f1d49 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -1001,6 +1001,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa self.screen_selector.show_popup('error', 'Sorry, we could not create a user session'); }else if(!self.pos.config){ self.screen_selector.show_popup('error', 'Sorry, we could not find any PoS Configuration for this session'); + }else if(self.pos.config.iface_fullscreen && document.body.webkitRequestFullscreen && ( + window.screen.availWidth > window.innerWidth || + window.screen.availHeight > window.innerHeight )){ + self.screen_selector.show_popup('fullscreen'); } self.$('.loader').animate({opacity:0},1500,'swing',function(){self.$('.loader').addClass('oe_hidden');}); @@ -1085,6 +1089,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.confirm_popup = new module.ConfirmPopupWidget(this,{}); this.confirm_popup.appendTo(this.$el); + this.fullscreen_popup = new module.FullscreenPopup(this,{}); + this.fullscreen_popup.appendTo(this.$el); + // -------- Misc --------- this.close_button = new module.HeaderButtonWidget(this,{ @@ -1140,6 +1147,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa 'error-no-client': this.error_no_client_popup, 'error-invoice-transfer': this.error_invoice_transfer_popup, 'confirm': this.confirm_popup, + 'fullscreen': this.fullscreen_popup, }, default_screen: 'products', default_mode: 'cashier', diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 929212cce8d..6f6be86b6d4 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -586,6 +586,51 @@ + + + +