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:

http://pythonhosted.org/OERPLib/tutorials.html#execute-queries

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

Language:
English Edit question
Status:
Answered
For:
OERPLib Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

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 :
#2

Keeping it opened...

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

Hi,

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.