[FIX] mail: set automatic email signature from correct company
When sending an email from a multi-company environment, the automatic email signature is not corresponding to the company from which the email is sent. This is because the user context is not properly forwarded, in particular the `allowed_company_ids` key. The issue comes from the new rpc service not autmatically adding the user context to the request, whereas the legacy rpc service did. opw-3394780 closes odoo/odoo#133596 X-original-commit: 5d6a0257ccd7f0b0f9a05050151ba66f35aeea37 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com> Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
@@ -42,6 +42,7 @@ export class ThreadService {
|
||||
this.notificationService = services.notification;
|
||||
this.router = services.router;
|
||||
this.ui = services.ui;
|
||||
this.user = services.user;
|
||||
this.messageService = services["mail.message"];
|
||||
this.personaService = services["mail.persona"];
|
||||
}
|
||||
@@ -814,7 +815,7 @@ export class ThreadService {
|
||||
thread,
|
||||
});
|
||||
const tmpId = this.messageService.getNextTemporaryId();
|
||||
params.context = { ...params.context, temporary_id: tmpId };
|
||||
params.context = { ...this.user.context, ...params.context, temporary_id: tmpId };
|
||||
if (parentId) {
|
||||
params.post_data.parent_id = parentId;
|
||||
}
|
||||
@@ -1088,6 +1089,7 @@ export const threadService = {
|
||||
"mail.message",
|
||||
"mail.persona",
|
||||
"ui",
|
||||
"user",
|
||||
],
|
||||
/**
|
||||
* @param {import("@web/env").OdooEnv} env
|
||||
|
||||
Reference in New Issue
Block a user