Browse Source

IMP action_print: Print invoice instead of ticket, if the order has one

pull/380/head
Iván Todorovich 6 years ago
committed by OCA-git-bot
parent
commit
c260117030
  1. 7
      pos_order_mgmt/static/src/js/widgets.js

7
pos_order_mgmt/static/src/js/widgets.js

@ -171,6 +171,13 @@ 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();

Loading…
Cancel
Save