summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2020-05-05 08:00:09 +0000
committerPierre Masereel <pim@odoo.com>2020-05-12 12:48:58 +0000
commitf87838046c3bcb2b5a73ad18fbff268232a4f30a (patch)
treecb3c75a173958b1e144ed31effc0bc1cf053c99c
parente773761d1038aab944f91c233d50fe2c4fb3914b (diff)
[REF] pos_epson_printer: migration to OWL framework
-rw-r--r--addons/pos_epson_printer/static/src/js/pos_epson_printer.js1
-rw-r--r--addons/pos_epson_printer/static/src/js/printers.js9
2 files changed, 4 insertions, 6 deletions
diff --git a/addons/pos_epson_printer/static/src/js/pos_epson_printer.js b/addons/pos_epson_printer/static/src/js/pos_epson_printer.js
index f72484623bb..c7d91c02021 100644
--- a/addons/pos_epson_printer/static/src/js/pos_epson_printer.js
+++ b/addons/pos_epson_printer/static/src/js/pos_epson_printer.js
@@ -2,7 +2,6 @@ odoo.define('pos_epson_printer.pos_epson_printer', function (require) {
"use strict";
var models = require('point_of_sale.models');
-var PaymentScreenWidget = require('point_of_sale.screens').PaymentScreenWidget;
var EpsonPrinter = require('pos_epson_printer.Printer');
var posmodel_super = models.PosModel.prototype;
diff --git a/addons/pos_epson_printer/static/src/js/printers.js b/addons/pos_epson_printer/static/src/js/printers.js
index e6536fa2406..86dda04915f 100644
--- a/addons/pos_epson_printer/static/src/js/printers.js
+++ b/addons/pos_epson_printer/static/src/js/printers.js
@@ -2,6 +2,7 @@
odoo.define('pos_epson_printer.Printer', function (require) {
"use strict";
+const { Gui } = require('point_of_sale.Gui');
var core = require('web.core');
var PrinterMixin = require('point_of_sale.Printer').PrinterMixin;
@@ -17,14 +18,13 @@ var EpsonPrinter = core.Class.extend(PrinterMixin, {
},
callback_connect: function (resultConnect) {
- var self = this;
var deviceId = 'local_printer';
var options = {'crypto' : false, 'buffer' : false};
if ((resultConnect == 'OK') || (resultConnect == 'SSL_CONNECT_OK')) {
this.ePOSDevice.createDevice(deviceId, this.ePOSDevice.DEVICE_TYPE_PRINTER, options, this.callback_createDevice.bind(this));
} else {
this.pos.chrome.ready.then(function () {
- self.pos.gui.show_popup('error', {
+ Gui.showPopup('ErrorPopup', {
'title': _t('Connection to the printer failed'),
'body': _t('Please check if the printer is still connected, if the configured IP address is correct and if your printer supports the ePOS protocol.'),
});
@@ -33,9 +33,8 @@ var EpsonPrinter = core.Class.extend(PrinterMixin, {
},
callback_createDevice: function (deviceObj, errorCode) {
- var self = this;
if (deviceObj === null) {
- this.pos.gui.show_popup('error', {
+ Gui.showPopup('ErrorPopup', {
'title': _t('Connection to the printer failed'),
'body': _t('Please check if the printer is still connected. Error code: ') + errorCode,
});
@@ -44,7 +43,7 @@ var EpsonPrinter = core.Class.extend(PrinterMixin, {
this.printer = deviceObj;
this.printer.onreceive = function(response){
if (!response.success) {
- self.pos.gui.show_popup('error', {
+ Gui.showPopup('ErrorPopup', {
'title': _t('Epson ePOS Error'),
'body': _t('An error happened while sending data to the printer. Error code: ') + response.code,
});