import products by module and csv

Asked by Alberto Garcia (Factor Libre)

I try to import product with a module but I have errors with the csv.

I did 2 csv.


producto_1,producto x,producto x,producto x,producto x,product,buy,make_to_order,1,10,True,True
producto_2,producto y,producto y,producto y,producto y,product,buy,make_to_order,1,20,True,True


1,code x,producto_1
2,code y,producto_2

when I try install de module to import I have this error:

Traceback (most recent call last):
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/", line 235, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/", line 74, in __call__
    return getattr(self, method)(*params)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/service/", line 582, in execute
    return self._execute(db, uid, wiz_id, datas, action, context)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/service/", line 562, in _execute
    return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/wizard/", line 178, in execute
    res = self.execute_cr(cr, uid, data, state, context)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/wizard/", line 74, in execute_cr
    action_res = action(self, cr, uid, data, context)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/addons/base/module/wizard/", line 92, in _upgrade_module
    db, pool = pooler.restart_pool(cr.dbname, update_module=True)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/", line 62, in restart_pool
    return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/", line 40, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/addons/", line 718, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/addons/", line 611, in load_module_graph
    tools.convert_csv_import(cr, m, os.path.basename(filename),, idref, mode=mode)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/tools/", line 853, in convert_csv_import
    pool.get(model).import_data(cr, uid, fields, datas,mode, module,noupdate,filename=fname_partial)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/osv/", line 641, in import_data
    process_liness(self, datas, [], fields_def)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/osv/", line 518, in process_liness
    id = ir_model_data_obj._get_id(cr, uid, module, xml_id)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/tools/", line 659, in cached_result
    result2 = fn(self2, cr, *args[:self.skiparg-2], **kwargs2)
  File "/home/agl00014/proyectos/openerp/logiscenter/src/openerp-server-5.0.1-0/bin/addons/base/ir/", line 420, in _get_id
    assert len(ids)==1, '%d reference(s) to %s.%s. You should have one and only one !' % (len(ids), module, xml_id)
AssertionError: 0 reference(s) to logiscenter_products1.producto_1. You should have one and only one !

Question information

English Edit question
Odoo Addons (MOVED TO GITHUB) Edit question
No assignee Edit question
Solved by:
Alberto Garcia (Factor Libre)
Last query:
Last reply:
Revision history for this message
Alberto Garcia (Factor Libre) (agarcia-flibre) said :

Topic solved by me

Revision history for this message
OscarAlca (oscarolar) said :

Hi Alberto, I want to import products too, but I dont know how to setup the .csv file, do you know how to do it? or do you have the csv template? any help will be appreciated.

Revision history for this message
Alberto Garcia (Factor Libre) (agarcia-flibre) said :

You can got to this link (is spanish) to get template csv to import:

Revision history for this message
OscarAlca (oscarolar) said :

thks man, that´s what I needed

Revision history for this message
Mahdi NOUKRATI (mahdink) said :

hi Alberto,
i want to import product to using csv file, itry the open the link that you proposed to OscarAlca but it doesn't work, can you give me a new link?? thinks