Skip to content
Snippets Groups Projects
Commit af80c68a authored by Shreya Modi's avatar Shreya Modi Committed by Thibault Delavallée
Browse files

[IMP] mail: improve create_uid heuristics in mail gateway


PURPOSE

Currently mailgateway runner user is used to create most documents through
incoming emails. Purpose of this commit is to try to link document creation
and update to users, using the email to make the matching.

SPECIFICATIONS

New sudo implementation allow to bypass access rights while keeping effective
user as creator. Use this mechanism to create documents still using the
mailgateway runner user while linking creator to matching user.

Heuristic to use to match email_from and users

* if route is linked to an alias: check its owner record and check in its
followers;
* find users having this emails;
* if route is linked to an alias: use alias_user_id field;
* fallback on mailgateway user;

Other side effect is that creator and author of incoming email linked to the
new record will now better match the document creator when linked to an
existing user.

LINKS

Task 1919267
PR #30597

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 109f3907
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment