0
votes

I am using Odoo on cloud instance, trying to import csv file from command line, when I tried to import it from psql to "crm.lead" table they are imported but the data does show up in Odoo application.

      COPY res_partner(name, website,email,phone)
      FROM '/home/ubuntu/sample/data.csv'
      WITH DELIMITER ','
      CSV HEADER;

     templ=# SELECT count(*) FROM res_partner;
     count 
     -------
     25647
    (1 row)

But in customers(Odoo) I can't find the data. I also tried some python script from some other sources

(http://www.firstclasscomputerconsulting.com/OpenERP/OpenERP70Videos/tabid/145/articleType/ArticleView/articleId/3/Import-data-into-OpenERP-7-using-direct-PostGRES-method.aspx)

but nothing works in my case. need some help.

2

2 Answers

0
votes
COPY table_name FROM '/path/to/csv/csv_file.csv' DELIMITER ',' CSV;

This query you can directly execute on postgresql as well as you can execute from python code.

0
votes

you need to add a customer field in CSV and set it to t in your csv to show in the customer fields.