OpenERP 报价单转订单时出错
-
OpenERP 报价单转订单时出错
报价单保存OK, 点订单确认时出现以下错误
OpenERP Server Error
Client Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\web\http.py", line 204, in dispatch
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\web\controllers\main.py", line 1132, in call_button
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\web\controllers\main.py", line 1120, in _call_kw
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\web\session.py", line 42, in proxy
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\web\session.py", line 30, in proxy_method
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\web\session.py", line 103, in send
Server Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\web\session.py", line 89, in send
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\netsvc.py", line 292, in dispatch_rpc
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\service\web_services.py", line 626, in dispatch
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\osv\osv.py", line 188, in execute_kw
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\osv\osv.py", line 131, in wrapper
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\osv\osv.py", line 197, in execute
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\osv\osv.py", line 185, in execute_cr
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\portal_sale\portal_sale.py", line 64, in action_button_confirm
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\sale\sale.py", line 577, in action_button_confirm
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\wkf_service.py", line 119, in trg_validate
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\instance.py", line 43, in validate
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 60, in process
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 175, in _split_test
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 183, in _join_test
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 40, in create
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 60, in process
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 175, in _split_test
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 183, in _join_test
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 40, in create
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 60, in process
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 175, in _split_test
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 183, in _join_test
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 40, in create
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 52, in process
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\workitem.py", line 106, in _execute
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\wkf_expr.py", line 67, in execute
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\workflow\wkf_expr.py", line 57, in _eval_expr
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\tools\safe_eval.py", line 241, in safe_eval
File "", line 1, in <module>
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\osv\orm.py", line 374, in function_proxy
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\sale_stock\sale_stock.py", line 447, in action_ship_create
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\sale_stock\sale_stock.py", line 415, in _create_pickings_and_procurements
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\stock\stock.py", line 622, in create
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\mail\mail_thread.py", line 242, in create
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\osv\orm.py", line 4319, in create
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\osv\orm.py", line 2489, in _add_missing_default_values
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server.\openerp\osv\orm.py", line 1583, in default_get
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\delivery\stock.py", line 140, in <lambda>
File "C:\Program Files (x86)\OpenERP 7.0-20130828-231133\Server\server\openerp\addons\delivery\stock.py", line 138, in _get_default_uom
IndexError: list index out of range -
如果没有删除重量的单位分类(Unit of Measure Categories),添加KG后挂到 Weight上就可以,如果已经删除了Weight。
因为是它是通过xml关联的,只添加数据是不行的。在手动添加完Weight之后,先查看Weight的数据库id,你可以通过url查看,一般是id=?? 或者在登陆开发者模式后在开发者菜单点击 View Log
应该到Settings / Configuration / Sequences & Identifiers / External Identifiers 搜索 “product_uom_categ_kgm” 如果找到则把Record ID改为你新的Weight id,如果没找到则新建
Module: product
External Identifier: product_uom_categ_kgm
Model Name: product.uom.categ
Record ID: Weight的数据库id -
今天遇到同样的问题...留个脚印
如果之前没安装过delivery模块,删除重量基本单位后,再安装delivery模块会报同样的错误。
报错的原因在这里 openerp\addons\delivery\stock.pyclass stock_move(osv.osv):<br />...<br /> def _get_default_uom(self,cr,uid,c):<br /> uom_categ, uom_categ_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'product_uom_categ_kgm')<br /> return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0]<br />
不知道这算不算安装上的一个bug
最好是不管系统原来有没有,安装delivery时,强制写入一条record,再次声明重量的默认单位
另外,自认为简单的解决办法(可能会覆盖一些你做过的修改):
将 addons\product\product_data.xml 中的
<data noupdate="1"> 改为
<data noupdate="0">
升级product模块,再安装delivery。