odoo-addon-mail-gateway 16.0.1.3.0__py3-none-any.whl → 18.0.1.0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of odoo-addon-mail-gateway might be problematic. Click here for more details.
- odoo/addons/mail_gateway/README.rst +41 -24
- odoo/addons/mail_gateway/__init__.py +1 -1
- odoo/addons/mail_gateway/__manifest__.py +7 -14
- odoo/addons/mail_gateway/controllers/__init__.py +0 -1
- odoo/addons/mail_gateway/controllers/gateway.py +5 -2
- odoo/addons/mail_gateway/hooks.py +3 -3
- odoo/addons/mail_gateway/i18n/es.po +68 -406
- odoo/addons/mail_gateway/i18n/it.po +5 -336
- odoo/addons/mail_gateway/i18n/mail_gateway.pot +140 -121
- odoo/addons/mail_gateway/models/__init__.py +4 -3
- odoo/addons/mail_gateway/models/{mail_channel.py → discuss_channel.py} +45 -17
- odoo/addons/mail_gateway/models/ir_websocket.py +1 -1
- odoo/addons/mail_gateway/models/mail_gateway.py +8 -8
- odoo/addons/mail_gateway/models/mail_gateway_abstract.py +3 -3
- odoo/addons/mail_gateway/models/mail_guest.py +6 -4
- odoo/addons/mail_gateway/models/mail_message.py +40 -21
- odoo/addons/mail_gateway/models/mail_notification.py +15 -8
- odoo/addons/mail_gateway/models/mail_thread.py +56 -10
- odoo/addons/mail_gateway/models/res_partner.py +10 -32
- odoo/addons/mail_gateway/models/res_users.py +3 -4
- odoo/addons/mail_gateway/models/res_users_settings.py +12 -0
- odoo/addons/mail_gateway/readme/CONTRIBUTORS.md +5 -0
- odoo/addons/mail_gateway/readme/{CREDITS.rst → CREDITS.md} +2 -1
- odoo/addons/mail_gateway/readme/DESCRIPTION.md +8 -0
- odoo/addons/mail_gateway/readme/ROADMAP.md +1 -0
- odoo/addons/mail_gateway/readme/USAGE.md +12 -0
- odoo/addons/mail_gateway/security/ir.model.access.csv +4 -2
- odoo/addons/mail_gateway/security/security.xml +9 -10
- odoo/addons/mail_gateway/static/description/index.html +46 -28
- odoo/addons/mail_gateway/static/src/components/chatter/chatter.esm.js +14 -0
- odoo/addons/mail_gateway/static/src/components/chatter/chatter.xml +42 -22
- odoo/addons/mail_gateway/static/src/components/composer/composer.esm.js +107 -0
- odoo/addons/mail_gateway/static/src/components/gateway_follower/gateway_follower.esm.js +35 -23
- odoo/addons/mail_gateway/static/src/components/gateway_follower/gateway_follower.xml +3 -5
- odoo/addons/mail_gateway/static/src/components/message/message.xml +15 -15
- odoo/addons/mail_gateway/static/src/components/message/message_patch.esm.js +67 -0
- odoo/addons/mail_gateway/static/src/components/message_notification_popover_content/message_notification_popover_content.xml +3 -7
- odoo/addons/mail_gateway/static/src/core/common/composer_model_patch.esm.js +22 -0
- odoo/addons/mail_gateway/static/src/core/common/discuss_app_model_patch.esm.js +25 -0
- odoo/addons/mail_gateway/static/src/core/common/mail_composer_send_dropdown.esm.js +27 -0
- odoo/addons/mail_gateway/static/src/core/common/mail_composer_send_dropdown.xml +15 -0
- odoo/addons/mail_gateway/static/src/core/common/message_actions.esm.js +25 -0
- odoo/addons/mail_gateway/static/src/core/common/message_model_patch.esm.js +25 -0
- odoo/addons/mail_gateway/static/src/core/common/notification_model_patch.esm.js +34 -0
- odoo/addons/mail_gateway/static/src/core/common/persona_model_patch.esm.js +10 -0
- odoo/addons/mail_gateway/static/src/core/common/store_service_patch.esm.js +18 -0
- odoo/addons/mail_gateway/static/src/core/common/thread_model_patch.esm.js +54 -0
- odoo/addons/mail_gateway/static/src/core/web/discuss_app_category_model_patch.esm.js +19 -0
- odoo/addons/mail_gateway/static/src/core/web/discuss_sidebar_category_item_patch.xml +16 -0
- odoo/addons/mail_gateway/static/src/core/web/gateway_core_web_service.esm.js +36 -0
- odoo/addons/mail_gateway/static/src/models/gateway.esm.js +21 -15
- odoo/addons/mail_gateway/static/src/models/gateway_channel.esm.js +20 -13
- odoo/addons/mail_gateway/static/src/models/gateway_follower.esm.js +23 -0
- odoo/addons/mail_gateway/tools/__init__.py +1 -0
- odoo/addons/mail_gateway/tools/discuss.py +16 -0
- odoo/addons/mail_gateway/views/mail_gateway.xml +7 -7
- odoo/addons/mail_gateway/views/mail_guest_views.xml +15 -0
- odoo/addons/mail_gateway/views/res_partner_gateway_channel.xml +3 -4
- odoo/addons/mail_gateway/views/res_users_settings_views.xml +12 -0
- odoo/addons/mail_gateway/wizards/mail_compose_gateway_message.py +19 -4
- odoo/addons/mail_gateway/wizards/mail_compose_gateway_message.xml +2 -7
- odoo/addons/mail_gateway/wizards/mail_guest_manage.py +2 -3
- odoo/addons/mail_gateway/wizards/mail_guest_manage.xml +2 -6
- odoo/addons/mail_gateway/wizards/mail_message_gateway_link.py +3 -6
- odoo/addons/mail_gateway/wizards/mail_message_gateway_link.xml +0 -2
- odoo/addons/mail_gateway/wizards/mail_message_gateway_send.py +0 -1
- odoo/addons/mail_gateway/wizards/mail_message_gateway_send.xml +0 -4
- {odoo_addon_mail_gateway-16.0.1.3.0.dist-info → odoo_addon_mail_gateway-18.0.1.0.0.3.dist-info}/METADATA +48 -30
- odoo_addon_mail_gateway-18.0.1.0.0.3.dist-info/RECORD +77 -0
- {odoo_addon_mail_gateway-16.0.1.3.0.dist-info → odoo_addon_mail_gateway-18.0.1.0.0.3.dist-info}/WHEEL +1 -1
- odoo_addon_mail_gateway-18.0.1.0.0.3.dist-info/top_level.txt +1 -0
- odoo/addons/mail_gateway/controllers/discuss.py +0 -11
- odoo/addons/mail_gateway/i18n/es_VE.po +0 -879
- odoo/addons/mail_gateway/readme/CONTRIBUTORS.rst +0 -2
- odoo/addons/mail_gateway/readme/DESCRIPTION.rst +0 -5
- odoo/addons/mail_gateway/readme/USAGE.rst +0 -9
- odoo/addons/mail_gateway/static/src/components/composer/composer.xml +0 -24
- odoo/addons/mail_gateway/static/src/components/discuss_sidebar/discuss_sidebar.xml +0 -17
- odoo/addons/mail_gateway/static/src/models/channel.esm.js +0 -33
- odoo/addons/mail_gateway/static/src/models/channel_member_view.esm.js +0 -39
- odoo/addons/mail_gateway/static/src/models/chatter.esm.js +0 -41
- odoo/addons/mail_gateway/static/src/models/composer.esm.js +0 -32
- odoo/addons/mail_gateway/static/src/models/composer_gateway_follower.esm.js +0 -32
- odoo/addons/mail_gateway/static/src/models/composer_view.esm.js +0 -103
- odoo/addons/mail_gateway/static/src/models/discuss.esm.js +0 -51
- odoo/addons/mail_gateway/static/src/models/discuss_sidebar_category.esm.js +0 -128
- odoo/addons/mail_gateway/static/src/models/discuss_sidebar_category_item.esm.js +0 -51
- odoo/addons/mail_gateway/static/src/models/gateway_channel_view.esm.js +0 -15
- odoo/addons/mail_gateway/static/src/models/guest.esm.js +0 -10
- odoo/addons/mail_gateway/static/src/models/message.esm.js +0 -76
- odoo/addons/mail_gateway/static/src/models/message_action.esm.js +0 -45
- odoo/addons/mail_gateway/static/src/models/message_action_list.esm.js +0 -37
- odoo/addons/mail_gateway/static/src/models/message_action_view.esm.js +0 -91
- odoo/addons/mail_gateway/static/src/models/message_view.esm.js +0 -13
- odoo/addons/mail_gateway/static/src/models/messaging_initializer.esm.js +0 -24
- odoo/addons/mail_gateway/static/src/models/notification.esm.js +0 -20
- odoo/addons/mail_gateway/static/src/models/partner.esm.js +0 -11
- odoo/addons/mail_gateway/static/src/models/thread.esm.js +0 -77
- odoo_addon_mail_gateway-16.0.1.3.0.dist-info/RECORD +0 -78
- odoo_addon_mail_gateway-16.0.1.3.0.dist-info/top_level.txt +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<templates xml:space="preserve">
|
|
3
|
+
|
|
4
|
+
<t t-inherit="mail.MailComposerSendDropdown" t-inherit-mode="extension">
|
|
5
|
+
<xpath expr="//Dropdown" position="attributes">
|
|
6
|
+
<!--Disable the dropdown to send later because the behavior
|
|
7
|
+
needs to be adapted to accept gateway messages. To be removed
|
|
8
|
+
when implemented.
|
|
9
|
+
-->
|
|
10
|
+
<attribute
|
|
11
|
+
name="t-if"
|
|
12
|
+
>env.model.config.resModel === "mail.compose.message"</attribute>
|
|
13
|
+
</xpath>
|
|
14
|
+
</t>
|
|
15
|
+
</templates>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {_t} from "@web/core/l10n/translation";
|
|
2
|
+
import {messageActionsRegistry} from "@mail/core/common/message_actions";
|
|
3
|
+
|
|
4
|
+
messageActionsRegistry
|
|
5
|
+
.add("link_gateway_to_thread", {
|
|
6
|
+
condition: (component) => {
|
|
7
|
+
return (
|
|
8
|
+
component.props.message.gateway_type &&
|
|
9
|
+
component.props.thread.model === "discuss.channel"
|
|
10
|
+
);
|
|
11
|
+
},
|
|
12
|
+
icon: "fa fa-link",
|
|
13
|
+
title: _t("Link to thread"),
|
|
14
|
+
onClick: (component) => component.onClickLinkGatewayToThread(),
|
|
15
|
+
sequence: 20,
|
|
16
|
+
})
|
|
17
|
+
.add("send_with_gateway", {
|
|
18
|
+
condition: (component) =>
|
|
19
|
+
!component.props.message.gateway_type &&
|
|
20
|
+
component.props.thread.model !== "discuss.channel",
|
|
21
|
+
icon: "fa fa-share-square-o",
|
|
22
|
+
title: _t("Send with gateway"),
|
|
23
|
+
onClick: (component) => component.onClickSendWithGateway(),
|
|
24
|
+
sequence: 20,
|
|
25
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {Message} from "@mail/core/common/message_model";
|
|
2
|
+
import {patch} from "@web/core/utils/patch";
|
|
3
|
+
import {url} from "@web/core/utils/urls";
|
|
4
|
+
import {stateToUrl} from "@web/core/browser/router";
|
|
5
|
+
|
|
6
|
+
patch(Message.prototype, {
|
|
7
|
+
setup() {
|
|
8
|
+
super.setup(...arguments);
|
|
9
|
+
this.gateway_thread_data = {};
|
|
10
|
+
},
|
|
11
|
+
get resUrl() {
|
|
12
|
+
if (!this.gateway_thread_data) {
|
|
13
|
+
return super.resUrl;
|
|
14
|
+
}
|
|
15
|
+
return url(
|
|
16
|
+
stateToUrl({
|
|
17
|
+
model: this.gateway_thread_data.model,
|
|
18
|
+
resId: this.gateway_thread_data.id,
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
get editable() {
|
|
23
|
+
return super.editable && !this.gateway_type;
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {Notification} from "@mail/core/common/notification_model";
|
|
2
|
+
import {patch} from "@web/core/utils/patch";
|
|
3
|
+
|
|
4
|
+
patch(Notification.prototype, {
|
|
5
|
+
get icon() {
|
|
6
|
+
if (this.gateway_type) {
|
|
7
|
+
return `fa fa-${this.gateway_type}`;
|
|
8
|
+
}
|
|
9
|
+
return super.icon;
|
|
10
|
+
},
|
|
11
|
+
get statusIcon() {
|
|
12
|
+
if (!this.gateway_type) {
|
|
13
|
+
return super.statusIcon;
|
|
14
|
+
}
|
|
15
|
+
// It can be overriden on the gateway implementation
|
|
16
|
+
switch (this.notification_status) {
|
|
17
|
+
case "process":
|
|
18
|
+
return "fa fa-hourglass-half";
|
|
19
|
+
case "pending":
|
|
20
|
+
return "fa fa-paper-plane-o";
|
|
21
|
+
case "sent":
|
|
22
|
+
return `fa fa-${this.gateway_type} text-success`;
|
|
23
|
+
case "bounce":
|
|
24
|
+
return `fa fa-${this.gateway_type} text-danger`;
|
|
25
|
+
case "exception":
|
|
26
|
+
return `fa fa-${this.gateway_type} text-danger`;
|
|
27
|
+
case "ready":
|
|
28
|
+
return "fa fa-send-o";
|
|
29
|
+
case "canceled":
|
|
30
|
+
return "fa fa-trash-o";
|
|
31
|
+
}
|
|
32
|
+
return "";
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {Persona} from "@mail/core/common/persona_model";
|
|
2
|
+
import {Record} from "@mail/core/common/record";
|
|
3
|
+
import {patch} from "@web/core/utils/patch";
|
|
4
|
+
|
|
5
|
+
patch(Persona.prototype, {
|
|
6
|
+
setup() {
|
|
7
|
+
super.setup();
|
|
8
|
+
this.gateway_channels = Record.many("GatewayChannel");
|
|
9
|
+
},
|
|
10
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {Store} from "@mail/core/common/store_service";
|
|
2
|
+
import {patch} from "@web/core/utils/patch";
|
|
3
|
+
|
|
4
|
+
patch(Store.prototype, {
|
|
5
|
+
async fetchData(thread, ...args) {
|
|
6
|
+
const result = await super.fetchData(thread, ...args);
|
|
7
|
+
thread.gateway_followers = result.gateway_followers;
|
|
8
|
+
return result;
|
|
9
|
+
},
|
|
10
|
+
async getMessagePostParams(params) {
|
|
11
|
+
const post_params = await super.getMessagePostParams(...arguments);
|
|
12
|
+
if (params.thread.gateway_notifications) {
|
|
13
|
+
post_params.post_data.gateway_notifications =
|
|
14
|
+
params.thread.gateway_notifications;
|
|
15
|
+
}
|
|
16
|
+
return post_params;
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {assignDefined, assignIn} from "@mail/utils/common/misc";
|
|
2
|
+
import {Record} from "@mail/core/common/record";
|
|
3
|
+
import {Thread} from "@mail/core/common/thread_model";
|
|
4
|
+
import {patch} from "@web/core/utils/patch";
|
|
5
|
+
import {url} from "@web/core/utils/urls";
|
|
6
|
+
|
|
7
|
+
patch(Thread, {
|
|
8
|
+
_insert(data) {
|
|
9
|
+
const thread = super._insert(...arguments);
|
|
10
|
+
if (thread.type === "gateway") {
|
|
11
|
+
assignIn(thread, data, ["anonymous_name", "gateway"]);
|
|
12
|
+
this.store.discuss.gateway.threads.add(thread);
|
|
13
|
+
}
|
|
14
|
+
return thread;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
patch(Thread.prototype, {
|
|
19
|
+
setup() {
|
|
20
|
+
super.setup();
|
|
21
|
+
this.gateway = Record.one("Gateway");
|
|
22
|
+
this.operator = Record.one("Persona");
|
|
23
|
+
this.gateway_notifications = [];
|
|
24
|
+
this.gateway_followers = Record.many("Persona");
|
|
25
|
+
},
|
|
26
|
+
get isChatChannel() {
|
|
27
|
+
return this.channel_type === "gateway" || super.isChatChannel;
|
|
28
|
+
},
|
|
29
|
+
get hasMemberList() {
|
|
30
|
+
return this.channel_type === "gateway" || super.hasMemberList;
|
|
31
|
+
},
|
|
32
|
+
get avatarUrl() {
|
|
33
|
+
if (this.channel_type !== "gateway") {
|
|
34
|
+
return super.avatarUrl;
|
|
35
|
+
}
|
|
36
|
+
return url(
|
|
37
|
+
`/web/image/discuss.channel/${this.id}/avatar_128`,
|
|
38
|
+
assignDefined({}, {unique: this.avatarCacheKey})
|
|
39
|
+
);
|
|
40
|
+
},
|
|
41
|
+
/** @param {Object} data */
|
|
42
|
+
update(data) {
|
|
43
|
+
super.update(data);
|
|
44
|
+
if ("gateway_id" in data && this.channel_type === "gateway") {
|
|
45
|
+
this.gateway = data.gateway_id;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
_computeDiscussAppCategory() {
|
|
49
|
+
if (this.channel_type === "gateway") {
|
|
50
|
+
return this.store.discuss.gateway;
|
|
51
|
+
}
|
|
52
|
+
return super._computeDiscussAppCategory(...arguments);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {DiscussAppCategory} from "@mail/core/public_web/discuss_app_category_model";
|
|
2
|
+
import {compareDatetime} from "@mail/utils/common/misc";
|
|
3
|
+
import {patch} from "@web/core/utils/patch";
|
|
4
|
+
|
|
5
|
+
patch(DiscussAppCategory.prototype, {
|
|
6
|
+
/**
|
|
7
|
+
* @param {import("models").Thread} t1
|
|
8
|
+
* @param {import("models").Thread} t2
|
|
9
|
+
*/
|
|
10
|
+
sortThreads(t1, t2) {
|
|
11
|
+
if (this.id === "gateway") {
|
|
12
|
+
return (
|
|
13
|
+
compareDatetime(t2.lastInterestDateTime, t1.lastInterestDateTime) ||
|
|
14
|
+
t2.id - t1.id
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
return super.sortThreads(t1, t2);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<templates>
|
|
3
|
+
<t
|
|
4
|
+
t-name="mail_gateway.DiscussSidebarChannel.main"
|
|
5
|
+
t-inherit="mail.DiscussSidebarChannel.main"
|
|
6
|
+
t-inherit-mode="extension"
|
|
7
|
+
>
|
|
8
|
+
<xpath expr="//ThreadIcon" position="attributes">
|
|
9
|
+
<attribute
|
|
10
|
+
name="t-if"
|
|
11
|
+
add="or thread.channel_type === 'gateway'"
|
|
12
|
+
separator=" "
|
|
13
|
+
/>
|
|
14
|
+
</xpath>
|
|
15
|
+
</t>
|
|
16
|
+
</templates>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {reactive} from "@odoo/owl";
|
|
2
|
+
import {registry} from "@web/core/registry";
|
|
3
|
+
import {user} from "@web/core/user";
|
|
4
|
+
|
|
5
|
+
export class GatewayCoreWeb {
|
|
6
|
+
constructor(env, services) {
|
|
7
|
+
Object.assign(this, {
|
|
8
|
+
busService: services.bus_service,
|
|
9
|
+
});
|
|
10
|
+
/** @type {import("@mail/core/common/store_service").Store} */
|
|
11
|
+
this.store = services["mail.store"];
|
|
12
|
+
}
|
|
13
|
+
setup() {
|
|
14
|
+
if (user.settings?.is_discuss_sidebar_category_gateway_open) {
|
|
15
|
+
this.store.discuss.gateway.isOpen = true;
|
|
16
|
+
}
|
|
17
|
+
this.busService.subscribe("res.users.settings", (payload) => {
|
|
18
|
+
if (payload) {
|
|
19
|
+
this.store.discuss.gateway.isOpen =
|
|
20
|
+
payload.is_discuss_sidebar_category_gateway_open ??
|
|
21
|
+
this.store.discuss.gateway.isOpen;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const gatewayCoreWeb = {
|
|
28
|
+
dependencies: ["bus_service", "mail.store"],
|
|
29
|
+
start(env, services) {
|
|
30
|
+
const gateway_core_web = reactive(new GatewayCoreWeb(env, services));
|
|
31
|
+
gateway_core_web.setup();
|
|
32
|
+
return gateway_core_web;
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
registry.category("services").add("mail_gateway.core.web", gatewayCoreWeb);
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import {Record} from "@mail/core/common/record";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
3
|
+
export class Gateway extends Record {
|
|
4
|
+
static id = "id";
|
|
5
|
+
/** @type {Object.<number, import("models").Gateway>} */
|
|
6
|
+
static records = {};
|
|
7
|
+
/** @returns {import("models").Gateway} */
|
|
8
|
+
static get(data) {
|
|
9
|
+
return super.get(data);
|
|
10
|
+
}
|
|
11
|
+
/** @returns {import("models").Gateway|import("models").Gateway[]} */
|
|
12
|
+
static insert() {
|
|
13
|
+
return super.insert(...arguments);
|
|
14
|
+
}
|
|
15
|
+
/** @type {Number} */
|
|
16
|
+
id;
|
|
17
|
+
/** @type {String} */
|
|
18
|
+
type;
|
|
19
|
+
/** @type {String} */
|
|
20
|
+
name;
|
|
21
|
+
}
|
|
22
|
+
Gateway.register();
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import {Record} from "@mail/core/common/record";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
3
|
+
export class GatewayChannel extends Record {
|
|
4
|
+
static id = "id";
|
|
5
|
+
/** @type {Object.<number, import("models").GatewayChannel>} */
|
|
6
|
+
static records = {};
|
|
7
|
+
/** @returns {import("models").GatewayChannel} */
|
|
8
|
+
static get(data) {
|
|
9
|
+
return super.get(data);
|
|
10
|
+
}
|
|
11
|
+
/** @returns {import("models").GatewayChannel|import("models").GatewayChannel[]} */
|
|
12
|
+
static insert() {
|
|
13
|
+
return super.insert(...arguments);
|
|
14
|
+
}
|
|
15
|
+
/** @type {Number} */
|
|
16
|
+
id;
|
|
17
|
+
/** @type {String} */
|
|
18
|
+
name;
|
|
19
|
+
gateway = Record.one("Gateway");
|
|
20
|
+
}
|
|
21
|
+
GatewayChannel.register();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {Record} from "@mail/core/common/record";
|
|
2
|
+
|
|
3
|
+
export class GatewayFollower extends Record {
|
|
4
|
+
static id = "id";
|
|
5
|
+
/** @type {Object.<number, import("models").GatewayFollower>} */
|
|
6
|
+
static records = {};
|
|
7
|
+
/** @returns {import("models").GatewayFollower} */
|
|
8
|
+
static get(data) {
|
|
9
|
+
return super.get(data);
|
|
10
|
+
}
|
|
11
|
+
/** @returns {import("models").GatewayFollower|import("models").GatewayFollower[]} */
|
|
12
|
+
static insert() {
|
|
13
|
+
return super.insert(...arguments);
|
|
14
|
+
}
|
|
15
|
+
/** @type {Number} */
|
|
16
|
+
id;
|
|
17
|
+
/** @type {String} */
|
|
18
|
+
name;
|
|
19
|
+
partner = Record.one("Persona");
|
|
20
|
+
channel = Record.one("GatewayChannel");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
GatewayFollower.register();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import discuss
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Copyright 2025 Tecnativa - Carlos Roca
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
|
+
|
|
4
|
+
from odoo.addons.mail.tools.discuss import Store
|
|
5
|
+
|
|
6
|
+
original_one_id = Store.one_id
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def extended_one_id(record, /, *, as_thread=False):
|
|
10
|
+
result = original_one_id(record, as_thread=as_thread)
|
|
11
|
+
if result and record._name == "res.partner":
|
|
12
|
+
result["gateway_channels"] = record.sudo().gateway_channel_ids.mail_format()
|
|
13
|
+
return result
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Store.one_id = staticmethod(extended_one_id)
|
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
string="Integrate Webhook"
|
|
16
16
|
icon="fa-plug"
|
|
17
17
|
name="set_webhook"
|
|
18
|
-
|
|
18
|
+
invisible="not can_set_webhook or integrated_webhook_state"
|
|
19
19
|
/>
|
|
20
20
|
<button
|
|
21
21
|
type="object"
|
|
22
22
|
string="Update Webhook"
|
|
23
23
|
name="update_webhook"
|
|
24
24
|
icon="fa-refresh"
|
|
25
|
-
|
|
25
|
+
invisible="not can_set_webhook or integrated_webhook_state != 'integrated'"
|
|
26
26
|
/>
|
|
27
27
|
<button
|
|
28
28
|
type="object"
|
|
29
29
|
string="Remove Webhook"
|
|
30
30
|
name="remove_webhook"
|
|
31
31
|
icon="fa-remove"
|
|
32
|
-
|
|
32
|
+
invisible="not integrated_webhook_state"
|
|
33
33
|
/>
|
|
34
34
|
</div>
|
|
35
35
|
<field name="can_set_webhook" invisible="1" />
|
|
@@ -71,16 +71,16 @@
|
|
|
71
71
|
<field name="name">mail.gateway.tree</field>
|
|
72
72
|
<field name="model">mail.gateway</field>
|
|
73
73
|
<field name="arch" type="xml">
|
|
74
|
-
<
|
|
74
|
+
<list>
|
|
75
75
|
<field name="name" />
|
|
76
|
-
<field name="token" />
|
|
77
|
-
</
|
|
76
|
+
<field name="token" password="True" />
|
|
77
|
+
</list>
|
|
78
78
|
</field>
|
|
79
79
|
</record>
|
|
80
80
|
<record model="ir.actions.act_window" id="mail_gateway_act_window">
|
|
81
81
|
<field name="name">Gateway</field>
|
|
82
82
|
<field name="res_model">mail.gateway</field>
|
|
83
|
-
<field name="view_mode">
|
|
83
|
+
<field name="view_mode">list,form</field>
|
|
84
84
|
<field name="domain">[]</field>
|
|
85
85
|
<field name="context">{}</field>
|
|
86
86
|
</record>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<odoo>
|
|
3
|
+
<record id="mail_guest_view_form" model="ir.ui.view">
|
|
4
|
+
<field name="inherit_id" ref="mail.mail_guest_view_form" />
|
|
5
|
+
<field name="model">mail.guest</field>
|
|
6
|
+
<field name="arch" type="xml">
|
|
7
|
+
<group position="inside">
|
|
8
|
+
<group name="gateway_info" invisible="not gateway_id">
|
|
9
|
+
<field name="gateway_id" />
|
|
10
|
+
<field name="gateway_token" password="1" readonly="1" />
|
|
11
|
+
</group>
|
|
12
|
+
</group>
|
|
13
|
+
</field>
|
|
14
|
+
</record>
|
|
15
|
+
</odoo>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<!-- Copyright 2024 Dixmit
|
|
3
3
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
|
|
4
4
|
<odoo>
|
|
5
|
-
|
|
6
5
|
<record model="ir.ui.view" id="view_res_partner_gateway_channel_form">
|
|
7
6
|
<field name="name">Partner Gateway Channel Form</field>
|
|
8
7
|
<field name="model">res.partner.gateway.channel</field>
|
|
@@ -23,11 +22,11 @@
|
|
|
23
22
|
<field name="name">Partner Gateway Channel Tree</field>
|
|
24
23
|
<field name="model">res.partner.gateway.channel</field>
|
|
25
24
|
<field name="arch" type="xml">
|
|
26
|
-
<
|
|
25
|
+
<list>
|
|
27
26
|
<field name="partner_id" />
|
|
28
27
|
<field name="gateway_id" />
|
|
29
28
|
<field name="gateway_token" />
|
|
30
|
-
</
|
|
29
|
+
</list>
|
|
31
30
|
</field>
|
|
32
31
|
</record>
|
|
33
32
|
|
|
@@ -46,7 +45,7 @@
|
|
|
46
45
|
<record model="ir.actions.act_window" id="res_partner_gateway_channel_act_window">
|
|
47
46
|
<field name="name">Gateway Partner Channels</field>
|
|
48
47
|
<field name="res_model">res.partner.gateway.channel</field>
|
|
49
|
-
<field name="view_mode">
|
|
48
|
+
<field name="view_mode">list,form</field>
|
|
50
49
|
<field name="domain">[]</field>
|
|
51
50
|
<field name="context">{}</field>
|
|
52
51
|
</record>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" ?>
|
|
2
|
+
<odoo>
|
|
3
|
+
<record id="res_users_settings_view_form" model="ir.ui.view">
|
|
4
|
+
<field name="model">res.users.settings</field>
|
|
5
|
+
<field name="inherit_id" ref="mail.res_users_settings_view_form" />
|
|
6
|
+
<field name="arch" type="xml">
|
|
7
|
+
<field name="is_discuss_sidebar_category_chat_open" position="after">
|
|
8
|
+
<field name="is_discuss_sidebar_category_gateway_open" />
|
|
9
|
+
</field>
|
|
10
|
+
</field>
|
|
11
|
+
</record>
|
|
12
|
+
</odoo>
|
|
@@ -61,10 +61,25 @@ class MailComposeGatewayMessage(models.TransientModel):
|
|
|
61
61
|
string="Bcc",
|
|
62
62
|
)
|
|
63
63
|
|
|
64
|
-
def
|
|
64
|
+
def _partner_ids_domain(self):
|
|
65
|
+
return [("id", "in", self.env.context.get("default_partner_ids", []))]
|
|
66
|
+
|
|
67
|
+
def _prepare_mail_values_dynamic(self, res_ids):
|
|
65
68
|
self.ensure_one()
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
values = super()._prepare_mail_values_dynamic(res_ids)
|
|
70
|
+
values[res_ids[0]]["gateway_notifications"] = [
|
|
71
|
+
{
|
|
72
|
+
"partner_id": channel.partner_id.id,
|
|
73
|
+
"channel_type": "gateway",
|
|
74
|
+
"gateway_channel_id": channel.id,
|
|
75
|
+
}
|
|
76
|
+
for channel in self.wizard_channel_ids
|
|
77
|
+
]
|
|
78
|
+
return values
|
|
79
|
+
|
|
80
|
+
def _prepare_mail_values_static(self):
|
|
81
|
+
values = super()._prepare_mail_values_static()
|
|
82
|
+
values["gateway_notifications"] = [
|
|
68
83
|
{
|
|
69
84
|
"partner_id": channel.partner_id.id,
|
|
70
85
|
"channel_type": "gateway",
|
|
@@ -72,4 +87,4 @@ class MailComposeGatewayMessage(models.TransientModel):
|
|
|
72
87
|
}
|
|
73
88
|
for channel in self.wizard_channel_ids
|
|
74
89
|
]
|
|
75
|
-
return
|
|
90
|
+
return values
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<!-- Copyright 2024 Dixmit
|
|
3
3
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
|
4
4
|
<odoo>
|
|
5
|
-
|
|
6
5
|
<record model="ir.ui.view" id="mail_compose_gateway_message_form_view">
|
|
7
6
|
<field name="model">mail.compose.gateway.message</field>
|
|
8
7
|
<field name="inherit_id" ref="mail.email_compose_message_wizard_form" />
|
|
@@ -29,15 +28,11 @@
|
|
|
29
28
|
<attribute name="required">0</attribute>
|
|
30
29
|
</field>
|
|
31
30
|
<xpath
|
|
32
|
-
expr="//
|
|
31
|
+
expr="//widget[@name='mail_composer_recipient_list']/.."
|
|
33
32
|
position="attributes"
|
|
34
33
|
>
|
|
35
|
-
<attribute name="invisible">
|
|
36
|
-
<attribute name="attrs" />
|
|
34
|
+
<attribute name="invisible">True</attribute>
|
|
37
35
|
</xpath>
|
|
38
36
|
</field>
|
|
39
37
|
</record>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
38
|
</odoo>
|
|
@@ -5,7 +5,6 @@ from odoo import fields, models
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class MailGuestManage(models.TransientModel):
|
|
8
|
-
|
|
9
8
|
_name = "mail.guest.manage"
|
|
10
9
|
_description = "Assign gateway guest to a partner"
|
|
11
10
|
|
|
@@ -31,10 +30,10 @@ class MailGuestManage(models.TransientModel):
|
|
|
31
30
|
"gateway_token": self.guest_id.gateway_token,
|
|
32
31
|
}
|
|
33
32
|
)
|
|
34
|
-
for member in self.env["
|
|
33
|
+
for member in self.env["discuss.channel.member"].search(
|
|
35
34
|
[("guest_id", "=", self.guest_id.id)]
|
|
36
35
|
):
|
|
37
|
-
self.env["
|
|
36
|
+
self.env["discuss.channel.member"].create(
|
|
38
37
|
self._channel_member_vals(member, partner)
|
|
39
38
|
)
|
|
40
39
|
member.unlink()
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<!-- Copyright 2024 Dixmit
|
|
3
3
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
|
4
4
|
<odoo>
|
|
5
|
-
|
|
6
5
|
<record model="ir.ui.view" id="mail_guest_manage_form_view">
|
|
7
6
|
<field name="model">mail.guest.manage</field>
|
|
8
7
|
<field name="arch" type="xml">
|
|
@@ -17,13 +16,13 @@
|
|
|
17
16
|
string="Create new partner"
|
|
18
17
|
class="btn-primary"
|
|
19
18
|
type="object"
|
|
20
|
-
|
|
19
|
+
invisible="partner_id"
|
|
21
20
|
/>
|
|
22
21
|
<button
|
|
23
22
|
name="merge_partner"
|
|
24
23
|
string="Merge"
|
|
25
24
|
class="btn-primary"
|
|
26
|
-
|
|
25
|
+
invisible="not partner_id"
|
|
27
26
|
type="object"
|
|
28
27
|
/>
|
|
29
28
|
<button string="Cancel" class="btn-default" special="cancel" />
|
|
@@ -31,7 +30,4 @@
|
|
|
31
30
|
</form>
|
|
32
31
|
</field>
|
|
33
32
|
</record>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
33
|
</odoo>
|
|
@@ -5,7 +5,6 @@ from odoo import api, fields, models
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class MailMessageGatewayLink(models.TransientModel):
|
|
8
|
-
|
|
9
8
|
_name = "mail.message.gateway.link"
|
|
10
9
|
_description = "Link message from gateway"
|
|
11
10
|
|
|
@@ -16,7 +15,7 @@ class MailMessageGatewayLink(models.TransientModel):
|
|
|
16
15
|
|
|
17
16
|
@api.model
|
|
18
17
|
def _selection_target_model(self):
|
|
19
|
-
models = self.env["ir.model"].
|
|
18
|
+
models = self.env["ir.model"].search([("is_mail_thread", "=", True)])
|
|
20
19
|
return [(model.model, model.name) for model in models]
|
|
21
20
|
|
|
22
21
|
def link_message(self):
|
|
@@ -32,11 +31,9 @@ class MailMessageGatewayLink(models.TransientModel):
|
|
|
32
31
|
gateway_notifications=[], # Avoid sending notifications
|
|
33
32
|
)
|
|
34
33
|
self.message_id.gateway_message_id = new_message
|
|
35
|
-
self.
|
|
36
|
-
self.
|
|
37
|
-
"mail.message/insert",
|
|
34
|
+
self.message_id._bus_send_store(
|
|
35
|
+
self.message_id,
|
|
38
36
|
{
|
|
39
|
-
"id": self.message_id.id,
|
|
40
37
|
"gateway_thread_data": self.message_id.sudo().gateway_thread_data,
|
|
41
38
|
},
|
|
42
39
|
)
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<!-- Copyright 2024 Dixmit
|
|
3
3
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
|
4
4
|
<odoo>
|
|
5
|
-
|
|
6
5
|
<record model="ir.ui.view" id="mail_message_gateway_link_form_view">
|
|
7
6
|
<field name="model">mail.message.gateway.link</field>
|
|
8
7
|
<field name="arch" type="xml">
|
|
@@ -24,5 +23,4 @@
|
|
|
24
23
|
</form>
|
|
25
24
|
</field>
|
|
26
25
|
</record>
|
|
27
|
-
|
|
28
26
|
</odoo>
|