diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 71db4e487d0..35ec6de981b 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -552,6 +552,7 @@ class pos_order(osv.osv): orders_to_save = [o for o in orders if o['data']['name'] not in existing_references] order_ids = [] + for tmp_order in orders_to_save: to_invoice = tmp_order['to_invoice'] order = tmp_order['data'] diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index b9c9605ed92..4db8439ab73 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -1665,6 +1665,13 @@ td { font-size: 18px; margin: 0px 16px 16px 16px; } +.pos .popup .comment.traceback { + height: 264px; + overflow: auto; + font-size: 14px; + text-align: left; + font-family: 'Inconsolata'; +} .pos .popup .footer{ position:absolute; bottom:0; diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 17278ed1bd9..222d5663621 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -451,7 +451,13 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal self.db.remove_order(order.id); }); return server_ids; - }).fail(function (unused, event){ + }).fail(function (error, event){ + if(error.code === 200 ){ // Business Logic Error, not a connection problem + self.pos_widget.screen_selector.show_popup('error-traceback',{ + message: error.data.message, + comment: error.data.debug + }); + } // prevent an error popup creation by the rpc failure // we want the failure to be silent as we send the orders in the background event.preventDefault(); diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index dcbe933ae64..0e1d9e06893 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -387,6 +387,9 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }, }); + module.ErrorTracebackPopupWidget = module.ErrorPopupWidget.extend({ + template:'ErrorTracebackPopupWidget', + }); module.ErrorSessionPopupWidget = module.ErrorPopupWidget.extend({ template:'ErrorSessionPopupWidget', diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index eaa506d91c6..8d55ad7224d 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -1086,6 +1086,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.error_invoice_transfer_popup = new module.ErrorInvoiceTransferPopupWidget(this, {}); this.error_invoice_transfer_popup.appendTo(this.$el); + this.error_traceback_popup = new module.ErrorTracebackPopupWidget(this,{}); + this.error_traceback_popup.appendTo(this.$el); + this.confirm_popup = new module.ConfirmPopupWidget(this,{}); this.confirm_popup.appendTo(this.$el); @@ -1146,6 +1149,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa 'choose-receipt': this.choose_receipt_popup, 'error-no-client': this.error_no_client_popup, 'error-invoice-transfer': this.error_invoice_transfer_popup, + 'error-traceback': this.error_traceback_popup, 'confirm': this.confirm_popup, 'fullscreen': this.fullscreen_popup, }, diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 6f6be86b6d4..423dc06748f 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -680,6 +680,20 @@ + + + +