Odoo Automatically get product images with Google Images
1 November, 2022 by
Deviati Nur Istiqomah


Automatically get product images with Google Images

The product images are very useful in Odoo, for example, to quickly find a product or check if you scanned the right one, but it can be a bit painful to set up especially if you have a lot of products. Google Custom Search allows finding images automatically for your product, based on their barcode, keeping your focus on what matters in your business.

Configuration

This functionnality requires configuration both on Google and on Odoo.

With a free Google account, you can get up to 100 free images per day. If you need a higher rate, you’ll have to upgrade to a billing account.

Google API dashboard

  1. Go to the Google Cloud Platform API & Services page to generate Google Custom Search API credentials. Log in with your Google account.

  2. Select or create an API project to store the credentials. Give it an explicit name (e.g. Odoo Images).

  3. In the credentials section, click on Create Credentials and select API Keys.

    API & Services page on Google Cloud Platform
  4. Save your API Key. You’ll need it for the next step in Odoo!

  5. Use the search bar to look for Google Custom Search API and select it.

    Search bar containing "Custom Search API" on Google Cloud Platform
  6. Enable the API.

    "Custom Search API" tile with Enable button highlighted on Google Cloud Platform

Google Programmable Search dashboard

  1. Go to Google Programmable Search Engine and click on Get Started. Log in with your Google account.

    Google Programmable Search Engine page with the **Get Started** button on the up-right of the page
  2. Fill the language and the name of the search engine. Give it an explicit name (e.g. Odoo Images).

     Note

    Google doesn’t allow to create a search engine without having entered at least one specific site to search on. You can put any website (e.g. www.google.com) for this step, we will remove it later.

  3. Validate the form by clicking on Create. Then, go to the edition mode of the search engine that you created (either by clicking on Control Panel on the confirmation page or by clicking on the name of your Search Engine on the Home page).

  4. In the basics tab, make sure to enable Image searchSafeSearch and Search the entire web.

     Note

    Once Search the entire web is enabled, you can safely delete the site that you put at the previous step.

  5. Save your Search Engine Id. You’ll need it for the next step in Odoo!

Odoo

  1. Go to Settings ‣ General Settings ‣ Integrations, activate Google Images and save.

  2. Go back to Settings ‣ General Settings‣ Integrations, enter your API Key and Search Engine ID in Google Images settings and save again.

Automatically get your product images in Odoo

The action to automatically get your product images in Odoo appears in any Products or Product Variants list view. Here is a step-by-step guide from the Inventory app.

  1. Go to the Products menu (Products ‣ Products or Products ‣ Product Variants) from any application that uses products like Inventory or Sales.

  2. On the list view, select the products that needs an image.

     Important

    Only the 10,000 first selected products or product variants will be processed.

     

     Note

    • Only the products or product variants with a barcode and without an image will be processed.

    • If you select a product that has one or more variants from the Products view, each variant matching the previous criteria will be processed.

  3. In the action menu, select Get Pictures from Google Images and validate by clicking on Get picture.

  4. You should see your images appearing incrementally.

     Note

    • Only the 10 first images are fetched immediatly. If you selected more than 10, the rest will be fetched as a background job.

    • The background job process about 100 images in a minute. If you reach the quota authorized by Google (either with a free or a paid plan), the background job will put itself on hold for 24 hours and continue where it stopped the day before.

Deviati Nur Istiqomah
1 November, 2022
Share this post
Archive