[FIX] hw_drivers: Print status ESC/POS printers

The status ticket contains ESC/POS commands but was printed on all
printers connected in USB. Plugging a printer that doesn't support
ESC/POS resulted in undefined behaviors.

We now only print this status ticket on ESC/POS printers.

closes odoo/odoo#40972

X-original-commit: c6a28b627cbe6f8bd1da4321c1329cbc1bde498d
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
This commit is contained in:
Antoine Prieels
2019-11-27 09:18:33 +00:00
parent 441759a5f1
commit 53bc9dcdc6
+1 -1
View File
@@ -87,7 +87,7 @@ class PrinterDriver(Driver):
'reason': None,
}
self.send_status()
if 'direct' in self._device_connection:
if 'direct' in self._device_connection and 'CMD:ESC/POS;' in self.dev['device-id']:
self.print_status()
@classmethod