[FIX] point_of_sale,pos_epson_printer: htmlToImgLetterRendering in every printer
The letterRendering setting was only properly set for the `Printer` class but not for the `EpsonPrinter`. closes odoo/odoo#82980 X-original-commit: 3bbf4bbcc0e1f81c1eddb91b54c3c863722aea46 Related: odoo/enterprise#23586 Signed-off-by: Masereel Pierre <pim@odoo.com>
This commit is contained in:
committed by
Pierre Masereel
parent
93627a6e9e
commit
86298440ec
@@ -42,10 +42,10 @@ class PrintResultGenerator {
|
||||
}
|
||||
|
||||
var PrinterMixin = {
|
||||
init: function() {
|
||||
init: function (pos) {
|
||||
this.receipt_queue = [];
|
||||
this.printResultGenerator = new PrintResultGenerator();
|
||||
this.htmlToImgLetterRendering = false; // Whether to render each letter seperately. Necessary if letter-spacing is used.
|
||||
this.pos = pos;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -104,7 +104,7 @@ var PrinterMixin = {
|
||||
$('.pos-receipt-print').empty();
|
||||
resolve(self.process_canvas(canvas));
|
||||
},
|
||||
letterRendering: self.htmlToImgLetterRendering,
|
||||
letterRendering: self.pos.htmlToImgLetterRendering(),
|
||||
})
|
||||
});
|
||||
return promise;
|
||||
@@ -131,9 +131,7 @@ var PrinterMixin = {
|
||||
|
||||
var Printer = core.Class.extend(PrinterMixin, {
|
||||
init: function (url, pos) {
|
||||
PrinterMixin.init.call(this, arguments);
|
||||
this.pos = pos;
|
||||
this.htmlToImgLetterRendering = pos.htmlToImgLetterRendering();
|
||||
PrinterMixin.init.call(this, pos);
|
||||
this.connection = new Session(undefined, url || 'http://localhost:8069', { use_cors: true});
|
||||
},
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ class EpsonPrintResultGenerator extends PrintResultGenerator {
|
||||
}
|
||||
|
||||
var EpsonPrinter = core.Class.extend(PrinterMixin, {
|
||||
init(ip) {
|
||||
PrinterMixin.init.call(this, arguments);
|
||||
init(ip, pos) {
|
||||
PrinterMixin.init.call(this, pos);
|
||||
var url = window.location.protocol + '//' + ip;
|
||||
this.address = url + '/cgi-bin/epos/service.cgi?devid=local_printer';
|
||||
this.printResultGenerator = new EpsonPrintResultGenerator(url);
|
||||
|
||||
Reference in New Issue
Block a user