From bc48e0033e2166728ae72739b72076ea67e86e74 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Fri, 6 Mar 2020 08:22:17 +0000 Subject: [PATCH] [FIX] point_of_sale: replace (re)invoice button with info message In POS Settings activate IoTBox, and its suboption 'Receipt Printer' Activate now 'Reprint Receipt' Open the POS, make an order, validate and go to a next new order. Click on 'Reprint Receipt', then 'Print Invoice', fill the customer and try again Server Error message will popup, reprinting the invoice is thus, impossible. In v13 the action warn the user to print the invoice via backend, so this commit replace entirely the button with the message opw-2195440 closes odoo/odoo#47049 Original-signed-off-by: pimodoo X-original-commit: d2a7300e8ebddf5dd812ffec75b3eda1a083aeeb --- addons/point_of_sale/i18n/point_of_sale.pot | 7 +++++++ addons/point_of_sale/static/src/css/pos.css | 3 ++- addons/point_of_sale/static/src/js/screens.js | 15 +-------------- addons/point_of_sale/static/src/xml/pos.xml | 4 +--- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot index 843c98f4efb..99fe05088b6 100644 --- a/addons/point_of_sale/i18n/point_of_sale.pot +++ b/addons/point_of_sale/i18n/point_of_sale.pot @@ -4408,6 +4408,13 @@ msgid "" "backend for the order: " msgstr "" +#. module: point_of_sale +#. openerp-web +#: code:addons/point_of_sale/static/src/xml/pos.xml:715 +#, python-format +msgid "The order has been synchronized earlier. To print the invoice please refer to the order in the backend" +msgstr "" + #. module: point_of_sale #: model:ir.model.fields,help:point_of_sale.field_pos_config__iface_precompute_cash msgid "" diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index ae66894fd7a..3819527461e 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -1513,7 +1513,8 @@ td { .pos .keyboard_frame, .pos .receipt-screen header, .pos .receipt-screen .top-content, - .pos .receipt-screen .centered-content .button { + .pos .receipt-screen .centered-content .button, + .pos .receipt-screen .centered-content .print_invoice { display: none !important; } .pos, diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 045659569e0..7725f9bea74 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1787,19 +1787,6 @@ var ReceiptScreenWidget = ScreenWidget.extend({ self.print(); } }); - var button_print_invoice = this.$('.button.print_invoice'); - button_print_invoice.click(function () { - var order = self.pos.get_order(); - var invoiced = self.pos.push_and_invoice_order(order); - self.invoicing = true; - - invoiced.catch(self._handleFailedPushForInvoice.bind(self, order, true)); // refresh - - invoiced.then(function(){ - self.invoicing = false; - self.gui.show_screen('receipt', {button_print_invoice: false}, true); // refresh - }); - }); }, render_change: function() { @@ -1807,7 +1794,7 @@ var ReceiptScreenWidget = ScreenWidget.extend({ this.$('.change-value').html(this.format_currency(this.pos.get_order().get_change())); var order = this.pos.get_order(); var order_screen_params = order.get_screen_data('params'); - var button_print_invoice = this.$('.button.print_invoice'); + var button_print_invoice = this.$('h2.print_invoice'); if (order_screen_params && order_screen_params.button_print_invoice) { button_print_invoice.show(); } else { diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 5244e4c2db8..b90c797b6bf 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -860,9 +860,7 @@
- +
Print Receipt