From 49589b0b0af1548f5e011f1cba91cfb47f8ded0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Todorovich?= Date: Wed, 24 Jul 2019 09:51:25 +0000 Subject: [PATCH] IMP: Print the invoice, but also the ticket.. --- pos_order_mgmt/static/src/js/widgets.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pos_order_mgmt/static/src/js/widgets.js b/pos_order_mgmt/static/src/js/widgets.js index 00deeef5..9503b262 100644 --- a/pos_order_mgmt/static/src/js/widgets.js +++ b/pos_order_mgmt/static/src/js/widgets.js @@ -171,13 +171,6 @@ odoo.define('pos_order_mgmt.widgets', function (require) { }, action_print: function (order_data, order) { - // If it's invoiced, we just print the invoice - if (order_data.to_invoice) { - return this.pos.chrome.do_action('point_of_sale.pos_invoice_report', { - additional_context: { active_ids: [order_data.id] } - }) - } - // Otherwise, we load the order to generate the ticket // We store temporarily the current order so we can safely compute // taxes based on fiscal position this.pos.current_order = this.pos.get_order(); @@ -201,6 +194,16 @@ odoo.define('pos_order_mgmt.widgets', function (require) { this.gui.show_screen('receipt'); this.pos.reloaded_order = false; } + + // If it's invoiced, we also print the invoice + if (order_data.to_invoice) { + this.pos.chrome.do_action('point_of_sale.pos_invoice_report', { + additional_context: { active_ids: [order_data.id] } + }) + } + + // Destroy the order so it's removed from localStorage + // Otherwise it will stay there and reappear on browser refresh order.destroy(); },