Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
8976 Visualizzazioni

Exports are very quickly unreadable and not understandable.

In my export I see a lot of these data in the uom and in the categories. Even if the categories are the same the data in the categories is not the same.

Is there a method to export products with usefull data in categories and uom?

Avatar
Abbandona
Autore Risposta migliore

Thanks to the Answer of Martin H. Bramwell and the comment of Ray Carnes I tested different things and found out what to do. I hope you both don't feel I steel your answer. I only try to explain what to do in small steps and what happens in my own words.

The method to get rid of __export__.product_product_19_26 and that kind of things in the export:

  1. Inspect your export.
  2. If you have this kind of rubbish in your export check the column name.
  3. Often this will be category id or oum id or others or both or more.

For each of these you or your user has made new categories, uom, or other. For reasons I do not understand the database is not ready for export and produces rubbisch in your export.

  1. Make an export of the above found categories, uom or other. If you do for some reason I do not understand the database is made ready for usefull export.

  2. Export again and be happy!

In my tested case the rubbisch has been changed in logical data:

  • Data in uom_id/id was changed in __export__.product_uom_10 /11/12 etc which was not unique and corresponding with the data in the other exported records.
  • Data in uom_po_id/id has been changed in __export__.product_uom_10 /11/12 .
  • Data in categ_id/id has been changed in __export__.product_category_19 /etc..

This is great and for me this is a breaktrough in the problem of export / import!

Avatar
Abbandona

I recently discovered that all of this is due to a very small bug in export. Like you I have always been exporting dependent data first, and every time I notice 'garbage' I am reminded I need to do this. You can get rid of this problem for good if you make a small change (until the bug is fixed in the release). Then you won't have to export categories or UoM's before products (in your example). https://bugs.launchpad.net/openobject-server/+bug/1194893

Autore

@Ray Carnes I visit the url. OK. What do you mean with "You can get rid of this problem for good if you make a small change"? Is there an other easier workaround than I described above?

Yes. Fix the bug that the URL references (and provides a diff patch for). This involves editing three lines in openerp/osv/orm.py and restarting your OpenERP server.

Risposta migliore

Does this answer help :

Why does my Openerp export rubbish?

If you want more meaningful record identifiers you will have to create them with SQL commands directly in the database in the ir_model_data table.

When exporting OpenERP looks in that table for an alternate key name. If it does not find one it generates an ugly one, like __export__.product_product_19_26.

Avatar
Abbandona

Recall (from the link Martin references) that if your categories or UoM's have no ID's, then OpenERP will incorrectly generate ID's for them. The way to get them correctly generated is to export the categories and UoM's before the products.

Excellent, Ray. Thanks. I had not ever done that myself, so I forgot about it.

Autore

Thanks to the Answer of Martin H. Bramwell and the comment of Ray Carnes I tested different things and found out what to do. I hope you both don't feel I steel your answer. I only try to explain what to do in small steps and what happens in my own words.

I am glad you are learning how to be successful with data exporting and importing. I am glad that you are sharing your experiences so everyone can benefit.

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

Please start a new question, and post what you have imported as well as what you are trying to import.

Post correlati Risposte Visualizzazioni Attività
0
ott 17
2894
1
mar 15
5779
9
apr 24
35542
1
giu 24
1000
1
mar 16
2450