|
| 1 | +=================================================== |
| 2 | +Automatically get product images with Google Images |
| 3 | +=================================================== |
| 4 | + |
| 5 | +The product images are very useful in Odoo, for example, to quickly find a product or check if you |
| 6 | +scanned the right one, but it can be a bit painful to set up especially if you have a lot of |
| 7 | +products. **Google Custom Search** allows finding images automatically for your product, based on |
| 8 | +their barcode, keeping your focus on what matters in your business. |
| 9 | + |
| 10 | +.. _product_images/configuration: |
| 11 | + |
| 12 | +Configuration |
| 13 | +============= |
| 14 | + |
| 15 | +This functionnality requires configuration both on Google and on Odoo. |
| 16 | + |
| 17 | +With a free Google account, you can get up to 100 free images per day. If you need a higher rate, |
| 18 | +you'll have to upgrade to a billing account. |
| 19 | + |
| 20 | +.. _product_images/google-api-dashboard: |
| 21 | + |
| 22 | +Google API dashboard |
| 23 | +-------------------- |
| 24 | + |
| 25 | +#. Go to the `Google Cloud Platform API & Services <https://console.developers.google.com/>`_ page |
| 26 | + to generate Google Custom Search API credentials. Log in with your Google account. |
| 27 | + |
| 28 | +#. Select or create an API project to store the credentials. Give it an explicit name |
| 29 | + (e.g. Odoo Images). |
| 30 | + |
| 31 | +#. In the credentials section, click on **Create Credentials** and select **API Keys**. |
| 32 | + |
| 33 | + .. image:: product_images/gcp-api-services.png |
| 34 | + :align: center |
| 35 | + :alt: API & Services page on Google Cloud Platform |
| 36 | + |
| 37 | +#. Save your **API Key**. You'll need it for the next step in Odoo! |
| 38 | + |
| 39 | +#. Use the search bar to look for **Google Custom Search API** and select it. |
| 40 | + |
| 41 | + .. image:: product_images/gcp-search.png |
| 42 | + :align: center |
| 43 | + :alt: Search bar containing "Custom Search API" on Google Cloud Platform |
| 44 | + |
| 45 | +#. Enable the API. |
| 46 | + |
| 47 | + .. image:: product_images/gcp-custom-search-api.png |
| 48 | + :align: center |
| 49 | + :alt: "Custom Search API" tile with Enable button highlighted on Google Cloud Platform |
| 50 | + |
| 51 | +.. _product_images/google-pse-dashboard: |
| 52 | + |
| 53 | +Google Programmable Search dashboard |
| 54 | +------------------------------------ |
| 55 | + |
| 56 | +#. Go to `Google Programmable Search Engine <https://programmablesearchengine.google.com/>`_ and |
| 57 | + click on **Get Started**. Log in with your Google account. |
| 58 | + |
| 59 | + .. image:: product_images/google-pse.png |
| 60 | + :align: center |
| 61 | + :alt: Google Programmable Search Engine page with the **Get Started** button on the up-right |
| 62 | + of the page |
| 63 | + |
| 64 | +#. Fill the language and the name of the search engine. Give it an explicit name |
| 65 | + (e.g. Odoo Images). |
| 66 | + |
| 67 | + .. note:: |
| 68 | + Google doesn't allow to create a search engine without having entered at least one specific |
| 69 | + site to search on. You can put any website (e.g. www.google.com) for this step, we will |
| 70 | + remove it later. |
| 71 | + |
| 72 | +#. Validate the form by clicking on **Create**. Then, go to the edition mode of the search engine |
| 73 | + that you created (either by clicking on **Control Panel** on the confirmation page or by |
| 74 | + clicking on the name of your Search Engine on the Home page). |
| 75 | + |
| 76 | +#. In the **basics** tab, make sure to enable **Image search**, **SafeSearch** and |
| 77 | + **Search the entire web**. |
| 78 | + |
| 79 | + .. note:: |
| 80 | + Once **Search the entire web** is enabled, you can safely delete the site that you put at the |
| 81 | + previous step. |
| 82 | + |
| 83 | +#. Save your **Search Engine Id**. You’ll need it for the next step in Odoo! |
| 84 | + |
| 85 | +.. _product_images/setup-in-odoo: |
| 86 | + |
| 87 | +Odoo |
| 88 | +---- |
| 89 | + |
| 90 | +#. Go to :menuselection:`Settings --> General Settings --> Integrations`, |
| 91 | + activate **Google Images** and save. |
| 92 | + |
| 93 | +#. Go back to :menuselection:`Settings --> General Settings--> Integrations`, enter your **API Key** |
| 94 | + and **Search Engine ID** in **Google Images** settings and save again. |
| 95 | + |
| 96 | +.. _product_images/get-product-images: |
| 97 | + |
| 98 | +Automatically get your product images in Odoo |
| 99 | +============================================= |
| 100 | + |
| 101 | +The action to automatically get your product images in Odoo appears in any Products or Product |
| 102 | +Variants list view. Here is a step-by-step guide from the Inventory app. |
| 103 | + |
| 104 | +#. Go to the Products menu (:menuselection:`Products --> Products` or :menuselection:`Products --> |
| 105 | + Product Variants`) from any application that uses products like Inventory or Sales. |
| 106 | + |
| 107 | +#. On the list view, select the products that needs an image. |
| 108 | + |
| 109 | + .. important:: |
| 110 | + Only the 10,000 first selected products or product variants will be processed. |
| 111 | + |
| 112 | + .. note:: |
| 113 | + - Only the products or product variants with a barcode and without an image will be processed. |
| 114 | + - If you select a product that has one or more variants from the Products view, each variant |
| 115 | + matching the previous criteria will be processed. |
| 116 | + |
| 117 | +#. In the action menu, select **Get Pictures from Google Images** and validate by clicking on |
| 118 | + **Get picture**. |
| 119 | + |
| 120 | +#. You should see your images appearing incrementally. |
| 121 | + |
| 122 | + .. note:: |
| 123 | + - Only the 10 first images are fetched immediatly. If you selected more than 10, the rest will |
| 124 | + be fetched as a background job. |
| 125 | + - The background job process about 100 images in a minute. If you reach the quota authorized |
| 126 | + by Google (either with a free or a paid plan), the background job will put itself on hold |
| 127 | + for 24 hours and continue where it stopped the day before. |
| 128 | + |
| 129 | +.. seealso:: |
| 130 | + - `Create, modify, or close your Google Cloud Billing account |
| 131 | + <https://cloud.google.com/billing/docs/how-to/manage-billing-account>`_ |
0 commit comments