You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

  1. /* Copyright 2019 Solvos Consultoría Informática
  2. License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  3. */
  4. odoo.define('pos_ticket_without_price.screens', function (require) {
  5. "use strict";
  6. var core = require('web.core');
  7. var screens = require('point_of_sale.screens');
  8. var QWeb = core.qweb;
  9. screens.ReceiptScreenWidget.include({
  10. renderElement: function() {
  11. var self = this;
  12. this._super();
  13. var button_print_click_handler = $._data(
  14. this.$el.find('.button.print')[0], 'events').click[0].handler;
  15. var button_print = this.$('.button.print');
  16. button_print.off('click');
  17. button_print.click(function(){
  18. self.render_receipt();
  19. button_print_click_handler();
  20. });
  21. var button_print_ticket_without_price =
  22. this.$('.button.print_ticket_without_price');
  23. button_print_ticket_without_price.click(function () {
  24. self.render_ticket_without_price();
  25. self.print();
  26. });
  27. },
  28. render_ticket_without_price: function() {
  29. this.$('.pos-receipt-container').html(
  30. QWeb.render('PosTicketWithoutPrice',
  31. this.get_receipt_render_env()));
  32. },
  33. });
  34. });