How to use OERPLib to perform imports with external_id

Asked by kvdb

I was using OERPLib to insert res.partner entries as described here:

It turned out to be the wrong approach if I also want to keep the id the entry had in the system I'm migrating away from.
In that case, people suggest using the CSV import functionality through the OpenERP GUI.

I hope this can also be accomplished through OERPLib instead.
Not sure if this question is frequently asked, but it would be very much appreciated to see a code example added to the docs.

Question information

English Edit question
OERPLib Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
kvdb (kc0) said :

Keeping it opened...

Revision history for this message
S├ębastien Alix (sebastien-alix) said :


AFAIK, you can't force your own 'id' value while inserting a new record, not through the RPC interface (so not with OERPLib).

Maybe it's possible with the CSV import system by using the 'import_data()' method (OpenERP <= 7) or 'load()' method (Odoo >= 8) of any data model with OERPLib), but I'm not sure, you can try.

Can you help with this problem?

Provide an answer of your own, or ask kvdb for more information if necessary.

To post a message you must log in.