hello
I want to add button in discuss channel chat near to notification settings button that do some python code
how do this?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
hello
I want to add button in discuss channel chat near to notification settings button that do some python code
how do this?
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
i try this code
threadActionsRegistry.add("custom_action", {
condition(component) {
// Show only in channel threads
return component.thread?.model === "discuss.channel";
},
async onClick(ev) {
const orm = useService("orm");
const notification = useService("notification");
try {
const result = this.orm.call(
"discuss.channel", // Model name
"chatbot_inactive", // Method name
[session.uid,ev], // Arguments
);
notification.add(result.message, { type: "success" });
} catch (error) {
notification.add(_t("Action failed"), { type: "danger" });
}
},
icon: "fa fa-fw fa-file", // Change icon as needed
name: _t("Custom Action"), // Button tooltip
});
that add button but nothing happen when i click it