Skip to Content
Menu
This question has been flagged
3 Replies
2985 Views

Hello everyone,
I need your help on trying to figure out on how can I import this categories structures into Odoo 12.

The excel file is provided with a separate categories structure like:

Product Name            Category 1 |       Category 2 |           Category 3
Test product 1 ...           Storage             Memory Card        Micro SD
Test product 2 ...          Storage             CD and DVD          CD
Test product 3 ...          Storage             CD and DVD          DVD
Test product 4 ...         Storage              CD and DVD          DVD-RW
Test product 5 ...         Computers        Desktop                  Desktop PCs
Test product 6 ...         Computers        Desktop                  All-in-one
... and so on... it's a huge list.

The structure above, has a parent/child structure but all are separate fields.

I need to import this structure into Odoo and have no idea on how to create this categories structure automatically via import process.

I was able to solve the problem for the 2 first categories using the following approach:

- For the Category 1, I set it as "Ascending Category" (create if no exist) and for the Category 2, I set as "category Name".

This allows me to correctly import the first and second category and the structure is as desired, problem is with the third category.

This will not be a one time import. I will require to import this list several times.

Thank you in advance

Best regards

PM    

Avatar
Discard

Hi Paulo: Are Category 1, Category 2 and Category 3 custom fields ? How do they relate to the standard Product Category field ?

Author

Hi Paresh,

These categories needs to be imported from an external source. They are not custom Odoo fields.

I need to find a solution for importing these categories into the core Odoo categories structures.

So each product has a category (3) which it's parent is category (2) which belongs to category (1)

So, product final category will be: Category 1/Category2/Category3

Everything works fine for 2 categories (using one as the parent for the other one). When it came to include the third one, things gets complicated.

Since I mostly need the last one (need others for organization purposes), I will use the functional approach to import first and second and add a static "xml_id" to this process.

Then, I will use this xml_id as the XML ID for the parent category on the third one.

Best regards

PM

Best Answer

I believe what you are asking is the format.  You already know you should create product category first. and import the product itself second.

Make your CSV/Excel looks like below, and import it to product category.

idnameparent_id/id
product_category_storage
Storage
product_category_cd_dvd
CD and DVDproduct_category_storage
product_category_cd
CDproduct_category_cd_dvd
product_category_dvd
DVDproduct_category_cd_dvd

Import product.template like this.

idnamecategory_id
product_template_test1Test1Storage / CD
product_template_test2
Test2
Storage / CD and DVD
product_template_test3
Test3
Storage / DVD

 

Avatar
Discard
Related Posts Replies Views Activity
0
Sep 20
1347
0
Oct 24
103
2
May 24
2371
0
Apr 24
312
0
Mar 24
275