Skip to Content
Menu
This question has been flagged
2 Replies
2819 Views

I'm using the hosted version of Odoo 17.

I manually entered a couple dozen products from a vendor then added pictures, set categories for Sales and POS, etc.

Now I received a full price list from the vendor (and I will be receiving updated pricelists every 6 months). 

I want to import the full price list without creating duplicate products. Reading through the docs, it seems the way to avoid creating duplicates is by using the External ID field. However, I have not found a way to export my current product list with the External ID.

How can I export my product list and include the External ID (as well as other fields that are not available in the column selector in the Products list view such as Ecommerce Shop/Categories)?

Perhaps an even better option would be if I could configure the import to prevent creating duplicate Internal Reference IDs. I already can't create a new product with the same Internal Reference in the UI, but Import doesn't enforce this constraint. Is it possible to configure Import to prevent duplicates?

Avatar
Discard
Best Answer

In Odoo, the External ID is mainly used for referencing records across different modules or between instances. It's not directly related to preventing duplicate products during import. However, to avoid creating duplicate products during import, you can use the Internal Reference field as a unique identifier.

Here's how you can export your product list with the Internal Reference field:

  1. Navigate to the Product listing in Odoo.
  2. Click on the "Export" button to export the product list.
  3. In the export wizard, select the fields you want to export, including the Internal Reference field.
  4. Export the data in a CSV or Excel file format.

Now, you have your product list exported with the Internal Reference field.

To configure the import to prevent creating duplicate Internal Reference IDs, you'll need to use a unique constraint on the Internal Reference field. Unfortunately, out-of-the-box, Odoo does not provide a direct option to enforce this constraint during the import process. However, you can achieve this through customization or by using a custom script to preprocess your data before import.

Here's an approach to enforce uniqueness during the import process:

  1. Before importing your price list, check the Internal Reference of each product in the price list against your existing product database.
  2. If a product with the same Internal Reference already exists, update the existing product with the new price information instead of creating a new product.
  3. If a product with a new Internal Reference is found, import it as a new product.

You can achieve this by writing a custom Python script that preprocesses your price list data before importing it into Odoo. This script would handle the logic to check for existing products and update them accordingly.

Additionally, you can explore Odoo's import options, such as the "Update existing records" option, which can update existing records based on a matching field. However, this option might not fully address your requirement since it updates records based on a specific field match, rather than enforcing uniqueness based on the Internal Reference field.

Customization or scripting may be necessary to achieve the exact behavior you're looking for. If you're not comfortable writing custom scripts, you might consider reaching out to an Odoo developer or consultant for assistance with this task.

Avatar
Discard
Author Best Answer

@Shajahan

Thank you for your response!

Originally, I couldn't find a way to "Export All", but after watching one of the tutorial videos I noticed that I needed to select some records (or all records) and then a new menu appeared that has the "Export All" option. 

With that help and a few more hours of troubleshooting import errors, I have now successfully imported all of my new products.

Thank you very much!

Avatar
Discard
Related Posts Replies Views Activity
1
Feb 24
1175
2
Jul 23
3283
3
Jul 20
3554
0
Aug 24
706
0
Jun 24
899