i did this but doesnt work :
odoo.define("custom_pos.CustomProductPopup", function (require) {
"use strict";
const PosComponent = require("point_of_sale.PosComponent");
const Registries = require("point_of_sale.Registries");
const { useListener } = require("@web/core/utils/hooks");
const core = require("web.core");
var _t = core._t;
class CustomProductPopup extends PosComponent {
setup() {
super.setup();
useListener("click", this.productClickHandler);
}
async productClickHandler() {
const product = this.props.product;
if (product.prescription_needed) {
this.showPopup("CustomPrescriptionPopup", {
title: _t("Prescription Needed"),
body: _t("This product requires a prescription."),
});
}
}
}
Registries.Component.add(CustomProductPopup);
return CustomProductPopup;
});