Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Is there a way to import products with a given Database ID ?

Xavier Brochard
on 10/8/16, 8:20 AM 121 views

For a project migrating from VirtueMart to Odoo, I need to keep the original Database ID in the product URL on the website. I need either to import products with their original Database ID or to change the product URL into something else using data from External ID or another field.

The simplest solution seems to change the product Database ID into the original one from VirtueMart. But how can I do that ? Can I edit tables in Postgresql without breaking all relational fields ? Is there a better solution ?

Hengky Zhang
On 10/11/16, 10:42 PM

in my opinion you can do that by external id

example : product.0011 --> (product.database_id)

then after that you can use query to update the database ID

update product_product set id = (select  name from ir_model_data imd where module = 'product' and res_id = product_product.id )

This seems the only practical solution. Thanks!

Xavier Brochard
on 10/18/16, 7:10 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 10/8/16, 8:20 AM
Seen: 121 times
Last updated: 10/18/16, 7:08 AM