[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 <pimodoo@users.noreply.github.com>
X-original-commit: d2a7300e8ebddf5dd812ffec75b3eda1a083aeeb
This commit is contained in:
Andrea Grazioso (agr-odoo)
2020-03-12 11:23:07 +00:00
committed by Pierre Masereel
parent 31551f8e51
commit bc48e0033e
4 changed files with 11 additions and 18 deletions
@@ -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 ""
+2 -1
View File
@@ -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,
+1 -14
View File
@@ -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 {
+1 -3
View File
@@ -860,9 +860,7 @@
</span>
</div>
<div class="centered-content touch-scrollable">
<div class="button print_invoice">
<i class='fa fa-print'></i> Print Invoice
</div>
<h2 class="print_invoice">The order has been synchronized earlier. To print the invoice please refer to the order in the backend</h2>
<div class="button print">
<i class='fa fa-print'></i> Print Receipt
</div>