Tower: upload havari_license_client 16.0.1.0.0 (was 16.0.1.0.0, via marketplace)

This commit is contained in:
2026-05-19 11:43:17 +00:00
parent 1f83918b72
commit 7726948957
22 changed files with 282 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
/** @odoo-module **/
import { browser } from "@web/core/browser/browser";
import { registry } from "@web/core/registry";
/**
* License Bus Service
* Listens for license status updates from the server and reloads the page when needed.
*/
export const licenseBusService = {
dependencies: ["bus_service", "notification"],
start(env, { bus_service, notification }) {
// Subscribe to license status updates
bus_service.subscribe("license/status_update", (payload) => {
console.log("License status update received:", payload);
const { module_name, action, state, message, requires_reload } = payload;
// Show notification to user
if (action === "suspend" || action === "revoke") {
notification.add(message || `License for ${module_name} has been ${state}`, {
title: "License Status Changed",
type: "danger",
sticky: true,
});
// Reload page after 3 seconds to apply changes
if (requires_reload) {
setTimeout(() => {
browser.location.reload();
}, 3000);
}
} else if (action === "activate") {
notification.add(message || `License for ${module_name} has been activated`, {
title: "License Activated",
type: "success",
sticky: false,
});
}
});
},
};
registry.category("services").add("license_bus", licenseBusService);