Skip to content

Commit

Permalink
[FIX] point_of_sale: customer display "get" action
Browse files Browse the repository at this point in the history
Customer display "get" action was missing `params` key, required for the IoT Box to understand
the request correctly.

closes odoo#191543

Signed-off-by: Yaroslav Soroko (yaso) <[email protected]>
  • Loading branch information
loouis-t committed Dec 23, 2024
1 parent cd3d9db commit b4869d2
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { deduceUrl, getOnNotified } from "@point_of_sale/utils";
import { registry } from "@web/core/registry";
import { session } from "@web/session";
import { _t } from "@web/core/l10n/translation";
import { AlertDialog } from "@web/core/confirmation_dialog/confirmation_dialog";

export const CustomerDisplayDataService = {
dependencies: ["bus_service", "dialog"],
async start(env, { bus_service, dialog }) {
dependencies: ["bus_service", "notification"],
async start(env, { bus_service, notification }) {
const data = reactive({});
if (session.type === "local") {
new BroadcastChannel("UPDATE_CUSTOMER_DISPLAY").onmessage = (event) => {
Expand All @@ -34,20 +33,24 @@ export const CustomerDisplayDataService = {
"Content-Type": "application/json",
},
body: JSON.stringify({
action: "get",
params: {
action: "get",
},
}),
}
);
const payload = await response.json();
Object.assign(data, payload.result.data);
} catch (error) {
dialog.add(AlertDialog, {
title: _t("IoT customer display error"),
body: _t(
"Error: %s.\nMake sure there is an IoT Box subscription associated with your Odoo database, then restart the IoT Box.",
error
notification.add(
_t(
"Make sure there is an IoT Box subscription associated with your Odoo database, then restart the IoT Box."
),
});
{
title: _t("IoT Customer Display Error"),
type: "danger",
}
);
console.error("Error fetching data for the IoT customer display: %s", error);
clearInterval(intervalId);
}
Expand Down

0 comments on commit b4869d2

Please sign in to comment.