Skip to content
Snippets Groups Projects
Unverified Commit 48eacdb7 authored by Odoo's Mergebot's avatar Odoo's Mergebot Committed by GitHub
Browse files

[MERGE] partner_autocomplete: enrich user companies


In order to make a wow effect right after DB install we enrich the base
company based on the given email address or company website at install.
In order to achieve that goal we use the partner_autocomplete service from
IAP. It uses free credits that are offered to new clients on saas platform.

Only the fields that are not filled yet are enriched to avoid erasing user
entered data, except logo. Indeed as partner_autocomplete is probably installed
as a core app (mail -> iap -> partner_autocomplete auto install chain) it is
unlikely that people already updated their company logo.

We consider that having a call to IAP consuming a token is ok for a standard
use case, especially that

  * if no iap service is configured call to IAP won't add much timing;
  * on Odoo SaaS free credits are given and company is enriched;
  * on custom SaaS with custom iap service, at db creation probably no
    credits are given and call will simply give no results back;

We decided to call IAP asynchronously at client web load. Session combined to
a boolean field on company model allows to do this call only once per company.
Doing this allows to avoid adding yet another post init hook. It also eases
behavior tweak through inheritance.

This call is limited to admin for obvious security reasons as well as
performance reason (limiting calls to external providers). As call will be
done once per company generally admin is the first person to log into the
its newly created Odoo.

In addition to enriching companies on the fly, we also enrich companies
when creating them. It allows to have an enrich on companies existing
before using autocomplete, and have results of enrich directly at create
for companies created after installing this module.

LINKS

Task ID-2322455
PR odoo/odoo#64600
PR odoo/upgrade#2086

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: default avatarDavid Beguin <dbe@odoo.com>
Co-authored-by: default avatarThibault Delavallee <tde@odoo.com>
parents 57b52e80 1b00a0b5
Branches
Tags
No related merge requests found
Showing
with 465 additions and 84 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment