[FIX] mail: Don't send negative id via rpc

Issue

    - Install live chat and website
    - In incognito mode, send a message via live chat (as public user)
    - Log in the database

    Erro: Record does not exist or has been deleted. (Record: res.partner(-1,), User: 2)

Cause

    Guest with negative id are sent to the server

Solution

    Don't send negative id

opw-2371677

closes odoo/odoo#61407

X-original-commit: 5dfd793470deed9ab459ccb2d747511213bc5bf9
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Achraf (abz)
2020-11-05 13:15:23 +00:00
parent 054fb95d73
commit 5dbd4d79ee
@@ -224,7 +224,7 @@ function factory(dependencies) {
static async _fetchImStatus() {
const partnerIds = [];
for (const partner of this.all()) {
if (partner.im_status !== 'im_partner') {
if (partner.im_status !== 'im_partner' && partner.id > 0) {
partnerIds.push(partner.id);
}
}