Product barcode lookup
Auto-fill product data from barcodes through the barcodelookup.com API, with quick enrichment and bulk image fetching.
The product_barcodelookup module connects Odoo to barcodelookup.com so product data can be retrieved from UPC or EAN barcodes. When the barcode is valid and the API key is configured, the system can automatically enrich product names, images, weight, descriptions, categories, and several common attributes.
This is especially useful when the business imports many new products and wants to speed up basic data entry for product or warehouse teams.
Business value
Key points
• Automatically fill product names, images, weight, reference sales price, descriptions, and categories from barcode data.
• Create product attributes such as color, size, brand, or material when the source response includes them.
• Support a bulk-image wizard for products that have barcodes but no product image yet.
• Use CRON-based background batches, which is suitable for large product sets and daily API limits.
• Reduce manual-entry effort when operations teams need to onboard many new products quickly.
Important fields and messages
| Fields | Trường dữ liệu | Description |
|---|---|---|
| Barcode Database | Cơ sở dữ liệu mã vạch | Settings area where the API key is entered. |
| API Key | Mã khóa API | Authentication key stored in system configuration. |
| Get Pictures from Barcode Lookup | Lấy ảnh từ Tìm kiếm mã vạch | Action used to fetch product images in bulk. |
| Is Image Fetch Pending | Đang chờ tìm nạp hình ảnh | Flag showing the product is queued for background image fetching. |
| Products are processed in the background | Sản phẩm đang được xử lý trong nền | Message shown after the wizard delegates remaining work to CRON. |
| The Barcode Lookup API key is not set properly or it is invalid | Khóa API Tìm kiếm mã vạch không hợp lệ | Common error when the API key is missing, invalid, or expired. |
API key setup
Key points
• Free plans commonly have a limit of 1000 requests per day.
• If there is no valid API key, the wizard blocks processing and points the user back to Settings.
Steps
1. Create an account on barcodelookup.com and obtain an API key.
2. Go to Settings → General Settings in Odoo.
3. Find the Barcode Database section and enter the API Key.
4. Save the configuration so the value is stored in ir.config_parameter.
5. Check user permissions, because full use normally requires Settings or System-level access.
Auto-fill behavior when entering a barcode
When an authorized user enters a sufficiently long valid barcode and leaves the field, Odoo calls the barcode lookup service and updates fields that are empty or still need enrichment.
Steps
1. Go to Inventory → Products → Products and create or open a product.
2. Enter a valid barcode such as UPC-A or EAN-13.
3. Leave the Barcode field to trigger onchange logic.
4. Review the auto-filled values and adjust anything that should follow internal naming or category standards.
5. Save the product after confirming the imported data is good enough for operational use.
Common auto-filled fields
| Field | Source | Notes |
|---|---|---|
| Name | title | Usually filled when the product name is still empty or needs an initial label |
| Image | images[] | Takes the first valid image returned by the API |
| Weight | weight | Supports lb-to-kg conversion or the reverse depending on system settings |
| List Price | stores[].price | May be converted into the company currency |
| Attributes | brand, color, size, material, ... | Created only when the product and user permissions allow it |
| Category / Description | category, description, features | Used to enrich newly created product records |
Bulk image fetching with the wizard
Key points
• The wizard prioritizes products that have a barcode and still do not have an image.
• The UI warns about image copyright, so downloaded images should be reviewed before publication.
Steps
1. Open the Products or Product Variants list.
2. Select multiple items and use Action → Get Pictures from Barcode Lookup.
3. The wizard shows the total selected, the number eligible for processing, and the number that cannot be processed.
4. Click Get Pictures to process an initial subset immediately.
5. The remaining products are flagged as pending and handed off to CRON.
Background processing and CRON
CRON trigger scenarios
| Scenario | Trigger timing | Meaning |
|---|---|---|
| Products still pending | Immediate or after 1 minute | Continue the next batch |
| API rate limit 429 | After 1 day | Wait for the next daily quota window |
| Repeated timeout or connection errors | After 1 hour | Give the external service time to recover |
| Normal background processing | ASAP | Return images quickly when the system is ready |
Error codes and reactions
| Code | System reaction | What to check |
|---|---|---|
| 403 | Stop and report invalid API key | Review the API key in Settings |
| 429 | Defer CRON to the next day | Watch daily API usage |
| 404 | Skip and continue | A specific barcode may have no result |
| Timeout / Connection Error | Retry, then defer if needed | Check network and external service health |
Automatic attributes and conversions
Key points
• The module can work with common attributes such as color, gender, material, brand, size, and age group.
• If a matching attribute does not already exist in master data, Odoo can enrich the product with corresponding information or place extra data in the description.
• Weight, dimensions, and volume can be converted based on the measurement system used in the database.
• Reference store pricing from the API should be treated as starter data, not the final commercial price policy.
Operational notes
Key points
• Use barcode lookup as a fast-start enrichment tool, then let the product team review naming, categories, and descriptions against internal standards.
• Track API quotas so the wizard does not stall unexpectedly after the daily request limit is reached.
• Not every downloaded image is safe for commercial reuse, so review legal or branding requirements before publishing.
• If the system says a background task is already running, wait for that CRON job instead of repeatedly starting more jobs.