[IMP] mail: add empty message (@ and #)

closes odoo/odoo#74933

Task-id: 2622240
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
Francois (fge)
2021-08-26 13:56:14 +00:00
parent dca9ca6464
commit 4500a72c1c
3 changed files with 11 additions and 12 deletions
@@ -4,4 +4,4 @@ import { registry } from "@web/core/registry";
import { _lt } from "@web/core/l10n/translation";
const commandCategoryRegistry = registry.category("command_categories");
commandCategoryRegistry.add("mail", { label: _lt("Discuss") }, { sequence: 20 });
commandCategoryRegistry.add("mail", {}, { sequence: 20 });
@@ -1,5 +1,6 @@
/** @odoo-module */
import { _lt } from "@web/core/l10n/translation";
import { registry } from "@web/core/registry";
const { Component } = owl;
@@ -13,10 +14,13 @@ DialogCommand.template = xml`
</div>
`;
const commandProviderRegistry = registry.category("command_provider");
const commandEmptyMessageRegistry = registry.category("command_empty_list");
commandEmptyMessageRegistry.add("@", _lt("No user found"));
commandEmptyMessageRegistry.add("#", _lt("No channel found"));
const commandProviderRegistry = registry.category("command_provider");
commandProviderRegistry.add("partner", {
nameSpace: "@",
namespace: "@",
async provide(newEnv, options) {
const messaging = await Component.env.services.messaging.get();
const suggestions = [];
@@ -43,7 +47,7 @@ commandProviderRegistry.add("partner", {
});
commandProviderRegistry.add("channel", {
nameSpace: "#",
namespace: "#",
async provide(newEnv, options) {
const messaging = await Component.env.services.messaging.get();
const channels = await messaging.models['mail.thread'].searchChannelsToOpen({