Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
11186 Visualizzazioni

The openerp-server help states that you can use the -P option to import data from the command line.

-P IMPORT_PARTIAL, --import-partial=IMPORT_PARTIAL
                    Use this for big data importation, if it crashes you
                    will be able to continue at the current state. Provide
                    a filename to store intermediate importation states.

From this I understand that I should run:

./openerp-server -P mydata.csv --stop-after-init

Is this correct? It doesn't seem to work.

And how do I "provide a filename to store intermediate importation states"?

Avatar
Abbandona
Risposta migliore

Not quite. If you look at server/openerp/tools/yaml_import.py at line 330, you can see a bit more into what's happening. Also in server/openerp/tools/convert.py scattered between lines 817 and 935.

Normally when you import into OpenERP using the standard interface, it will process the entire batch at once, and then commit everything to the database if there are no exceptions raised during the import process. When you set --import-partial, you're committing after every single successful line to be imported. The file that you provide is the name of the file to dump the remaining records that were not imported once the failure occurred, so you won't have to import all of the initial, good records again until you solve every problem in the entire import.

tl;dr: It's not importing from the command line, it's altering how normal importing works.

Avatar
Abbandona
Autore

So, I got it totally wrong then.

Does that mean there's no way to import CSV files from the command line?

There is this: https://erpmoldeo.wordpress.com/2011/05/10/importing-products-with-web-services-in-openerp/

Post correlati Risposte Visualizzazioni Attività
1
mag 19
6676
1
mar 15
5379
1
feb 25
1077
0
dic 22
2142
3
mar 15
10144