in <https://bugs.tryton.org/roundup/issue1368> Cedk wrote:
> But the export doesn't work for import.
> The format is different especially with the relational fields.
So my questions are:
* How do I export hierarchical categories from a database?
* How do I import hierarchical categories into a database?
I would have expected to be able to import the categories I just exported.
--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP
Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de
Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult mit Mitglied bei http://www.7-it.de
Thats really wired. "The export doesn't work for import." - Then i
would like to know what for is exporting and importing used within
Tryton?
Martin
Like you already do.
> * How do I import hierarchical categories into a database?
This is linked to categories (issue1369 [1]) because the rec_name of
categories can not be used to search on it. So without the fix, you should use
only the name of the category to import it. The csv header will look:
name,parent
Cat,
Child1,Cat
Child2,Child1
this will produce:
Cat
|- Child1
|- Child2
This will work if you have unique name of categories.
>
> I would have expected to be able to import the categories I just exported.
>
It works but it should follow some rules for the relational fields.
- For selection, you must set the internal value (It could be improved to use
the translated value if internal doesn't match)
- For many2one, you must set the value of rec_name, Tryton will use the first
found record that have the same rec_name.
- For many2many, it works like many2one except that it allow many values
separated by comma.
- For one2many, see http://code.google.com/p/tryton/wiki/ImportData
In conclusion, the import/export was not design to import the exported data.
It was design to export data for external purpose and to import data from
external sources.
[1] http://bugs.tryton.org/roundup/issue1369
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email: cedric...@b2ck.com
Jabber: cedric...@b2ck.com
Website: http://www.b2ck.com/
twitter: http://twitter.com/cedrickrier
identi.ca: http://identi.ca/cedrickrier
But it can be improved if anyone has ideas post it on tryton-dev.