Odoo Help


Why does my Openerp export rubbish?

on 5/3/13, 6:56 AM 1,939 views

When I watch something like this I see beautiful outputted data sets such as partner = "Fred Blogs", "Mr Openerp"

Why do I get partner = "__export__.sale_order_1884", "__export__.sale_order_1891"

I know its because I'm not getting "partner" Im getting "partner/id"

But why?

Is there a better / easier PostgreSQL export tool I could use?

Many thanks

This is not only for v7 it is also the situation for v6.1

on 5/4/13, 5:52 AM



| 5 6 8
Cornwall, Canada

Analysing, designing, coding and mentoring since 1975. Kilobytes to terabytes. Punch cards to punchy sites. My OpenERP video series: http://www.youtube.com/playlist?list=PLq7op4J183lX44ZlXPiHxUpRvmmRDtxye My Google Speadsheets --> OpenERP Data Pump project: http://martinhbramwell.github.io/GData_OpenERP_Data_Pump My email (with spaces removed) : mhb . warehouseman @ gmail . com

On 5/3/13, 9:17 AM

The record keys in their video, ('partner_id'), are nice human-readable text because they imported them that way. Those records were not entered into OpenERP by an end-user.

Every database record requires an identification key that is unique within that data table. OpenERP creates those using database sequential number sources called sequences. However, products like OpenERP benefit hugely from interconnectivity, and therefore have also to trust to unique identifiers supplied from outside.

You will find an extremely long and narrow data table called ir_model_data (model: ir.model.data):

select id, res_id, name, module, model from ir_model_data where name = 'FredBlogs';
    id  | res_id |    name   | module |    model
   8349 |      6 | FredBlogs |        | res.partner
  (1 row)

That query shows that a mapping was recorded for the res.partner data table at row 8349 in the table ir_model_data. The res.partner table primary key 6 is mapped to an external key 'FredBlogs', which was provided at the time the record was imported.

When it is time to export that data, the external id is provided, rather than the internal one. If no external id has been provided then an ugly generic one is generated (such as: "__export__.sale_order_1884" and "__export__.sale_order_1891").

Is there a better / easier PostgreSQL export tool I could use?

Once I got comfortable with working with the conceptual structure outlined above I ceased to view working with the database directly as a suitable option! SQL is very "rigid" and would require constant manual adaptation to changes wrought by future subclassing and extending of the modules whose data the tables record. It's really important to work through the Object Relational Mapping (ORM) layer!

Meanwhile . . . I agree that loading the database, one model at a time, using the import dialog is excessively labour intensive, and far from ideal, hence my work on my little GData OpenERP Data Pump.

Many thanks

on 5/3/13, 11:54 AM

Glad to be able to help. Do you have any lingering doubts?

on 5/3/13, 12:30 PM

For completeness to this great answer, records that are entered via the UI won't have an XML id until exported. If they are exported from a related record, that ID will be wrong. An example of this would be trying to export accounting transactions without first exporting the journals and accounts that they relate to. The account_id field will have incrementally generated ID's that match the line number in the export file, but won't related back to the accounts. You need to be careful what order you export data that you have entered via the UI (also including years and periods)

Ray Carnes
on 5/3/13, 6:23 PM

Thanks Ray. That's a hidden ugly I had not encountered. Certainly worth taking care about.

on 5/3/13, 6:52 PM

If what you say in your first alinea the video is not only extremely bad in audio it is also misleading in content.

on 5/4/13, 11:56 AM

I agree. But then, one can't really criticize Fabien for doing a rush job on it, considering everything else he does, eh?.

on 5/4/13, 12:13 PM

@Martin You are right. There are so much good things a forgot to mention, OpenERP is great, and I am impressed by what OpenERP and Fabian are doing. Sometimes I am too sharp.

on 5/4/13, 12:36 PM

I tried doing the same way you guys described here but now I feel like hell. Please anyone brief me How do I cope up with this difficulty. I am importing products and my error is: ValueError: No such external ID currently defined in the system: __export__.product_category_45 I already imported my product_category

on 12/5/13, 3:37 AM

evon, this is not the right way to ask this question. You have a new issue and therefore should ask it as question. Moreover you need to provide a lot more details before it will be possible to suggest an answer.

on 12/5/13, 8:39 AM
on 12/6/13, 12:36 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/3/13, 6:56 AM
Seen: 1939 times
Last updated: 3/16/15, 8:10 AM