Browse Source

IMP: Print the invoice, but also the ticket..

pull/380/head
Iván Todorovich 5 years ago
committed by OCA-git-bot
parent
commit
49589b0b0a
  1. 17
      pos_order_mgmt/static/src/js/widgets.js

17
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();
},

Loading…
Cancel
Save