Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

用模块的方法导入关联数据报错的问题



  • 我将res.partner res.partner.address res.partner.contact都导进去了,在导res.partner.job时报错了。<br />res.partner.job数据:<br />

    id,contact_id:id,address_id:id,state,sequence_partner,sequence_contact,<br />partner_job77,contact_104,address_144,current,0,0
    

    <br /><br />报错信息<br />

    Environment Information : <br />System : Linux-2.6.38-8-generic-i686-with-Ubuntu-11.04-natty<br />OS Name : posix<br />Distributor ID:	Ubuntu<br />Description:	Ubuntu 11.04<br />Release:	11.04<br />Codename:	natty<br />Operating System Release : 2.6.38-8-generic<br />Operating System Version : #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011<br />Operating System Architecture : 32bit<br />Operating System Locale : zh_CN.UTF8<br />Python Version : 2.7.1+<br />OpenERP-Client Version : 6.0.2<br />Last revision No. &amp; ID :Bazaar Package not Found !Traceback (most recent call last):<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/netsvc.py&quot;, line 489, in dispatch<br />&nbsp; &nbsp; result = ExportService.getService(service_name).dispatch(method, auth, params)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/service/web_services.py&quot;, line 596, in dispatch<br />&nbsp; &nbsp; security.check(db,uid,passwd)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/service/security.py&quot;, line 43, in check<br />&nbsp; &nbsp; pool = pooler.get_pool(db)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/pooler.py&quot;, line 79, in get_pool<br />&nbsp; &nbsp; pool = get_db_and_pool(db_name, force_demo, status, update_module)[1]<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/pooler.py&quot;, line 39, in get_db_and_pool<br />&nbsp; &nbsp; addons.load_modules(db, force_demo, status, update_module)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/addons/__init__.py&quot;, line 883, in load_modules<br />&nbsp; &nbsp; processed_modules.extend(load_module_graph(cr, graph, status, report=report, skip_modules=processed_modules))<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/addons/__init__.py&quot;, line 748, in load_module_graph<br />&nbsp; &nbsp; load_init_update_xml(cr, m, idref, mode, kind)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/addons/__init__.py&quot;, line 635, in load_init_update_xml<br />&nbsp; &nbsp; tools.convert_csv_import(cr, m, os.path.basename(filename), fp.read(), idref, mode=mode, noupdate=noupdate)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/tools/convert.py&quot;, line 947, in convert_csv_import<br />&nbsp; &nbsp; result, rows, warning_msg, dummy = pool.get(model).import_data(cr, uid, fields, datas,mode, module, noupdate, filename=fname_partial)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/osv/orm.py&quot;, line 868, in import_data<br />&nbsp; &nbsp; process_liness(self, datas, &#91;], current_module, self._name, fields_def, position=position)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/osv/orm.py&quot;, line 818, in process_liness<br />&nbsp; &nbsp; res = _get_id(relation, line[i], current_module, mode)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/osv/orm.py&quot;, line 732, in _get_id<br />&nbsp; &nbsp; record_id = ir_model_data_obj._get_id(cr, uid, module, xml_id)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/tools/misc.py&quot;, line 823, in cached_result<br />&nbsp; &nbsp; result2 = fn(self2, cr, *args[:self.skiparg-2], **kwargs2)<br />&nbsp; File &quot;/home/pengyong/workspace/openerp-server602/bin/addons/base/ir/ir_model.py&quot;, line 602, in _get_id<br />&nbsp; &nbsp; raise ValueError(&#039;No references to %s.%s&#039; % (module, xml_id))<br />ValueError: No references to 208_20110622_partner.contact_104,address_144<br />
    


  • 推荐用 xml 的数据来导入 关联性很强的数据组... <br /><br />具体可以参阅 addons 里面 茫茫多的 _data.xml 文件..