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

由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

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

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

OpenERP 6.1.1中明细帐查询问题



  • 使用明细帐查询功能时出现如下错误提示:
    Client Traceback (most recent call last):
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 180, in dispatch
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 1161, in load
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 1043, in fields_view_get
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 250, in proxy
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 117, in proxy
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 611, in send


    Server Traceback (most recent call last):
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 592, in send
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\netsvc.py", line 360, in dispatch_rpc
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\service\web_services.py", line 572, in dispatch
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 167, in execute_kw
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 121, in wrapper
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 176, in execute
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 164, in execute_cr
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\account\account_move_line.py", line 967, in fields_view_get
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 2149, in fields_view_get
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 1789, in __view_look_dom_arch
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 1695, in __view_look_dom
      File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\account\account_move_line.py", line 930, in view_header_get
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\sql_db.py", line 152, in wrapper
      File "C:\Program Files\OpenERP 6.1-1\server.\openerp\sql_db.py", line 212, in execute
    DataError: 錯誤:  無效的 integer 輸入語法: "04/2012"
    LINE 1: SELECT code FROM account_period WHERE id = '04/2012'

    跟踪发现为OE6.1.1中的一个BUG ,代码如下:
    account_move_line.py,line 207
                if type(period_id) == str :
                    ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)])
                    context.update({
                        'period_id': ids[0]
                    })
    如上if语句中,如果type(period_id)返回一个unicode字符,则不会执行if语句里面的代码了,最后就会出上如上错误提示窗口.将if语句if type(period_id) == str :修改为if type(period_id) == str or type(period_id) == unicode:就可以了,我的运行环境为服务器windows2003,客户端vista,postgresql 9.1,浏览器为firefox10.0.3



  • 赞, 为贴子加上一些 Tags 就更好了..

    推荐:

    <br />....<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if isinstance(period_id, (str,unicode)) :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ids = period_obj.search(cr, uid, [(&#039;name&#039;, &#039;ilike&#039;, period_id)])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context.update({<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;period_id&#039;: ids[0]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br />....<br />
    


  • ok!
    if isinstance(period_id, (str,unicode)) :更pythonic

    另外,TAG在哪里加?


Log in to reply