[FIX] point_of_sale: cashdrawer does not open in direct device
Connecting a cashdrawer to an ePoS printer in direct device ( NOT with an IoT box) will not automatically open the cashdrawer as it would be intended when paying with cash. This happens due to the fact that we check that the printer connection is "connected" which is not the case with direct device as it use the default value in the setup which is "disconnected". opw-3470241 closes odoo/odoo#133216 X-original-commit: 339a76885db0f2034bae21eec76d0127d2733205 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Loan Sens (lse) <lse@odoo.com>
This commit is contained in:
@@ -25,7 +25,7 @@ export class HardwareProxy extends EventBus {
|
||||
this.useDebugWeight = false;
|
||||
this.host = "";
|
||||
this.keptalive = false;
|
||||
this.connectionInfo = reactive({ status: "disconnected", drivers: {} });
|
||||
this.connectionInfo = reactive({ status: "init", drivers: {} });
|
||||
effect(
|
||||
(info) => {
|
||||
if (info.status === "connected" && this.printer) {
|
||||
@@ -191,7 +191,11 @@ export class HardwareProxy extends EventBus {
|
||||
return this.message("log", { arguments: [...arguments] });
|
||||
}
|
||||
async openCashbox(action = false) {
|
||||
if (this.pos.config.iface_cashdrawer && this.connectionInfo.status === "connected") {
|
||||
if (
|
||||
this.pos.config.iface_cashdrawer &&
|
||||
this.printer &&
|
||||
["connected", "init"].includes(this.connectionInfo.status)
|
||||
) {
|
||||
this.printer.openCashbox();
|
||||
if (action) {
|
||||
this.pos.logEmployeeMessage(action, "CASH_DRAWER_ACTION");
|
||||
|
||||
Reference in New Issue
Block a user