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

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

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

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

Openerp的gtk客户端万能查询功能中文bug



  • 也不知道是不是BUG,也许是配置不对,请高手拍砖,我反正用下面方法解决问题了,以下是我的方法:<br />  GTK客户端与WEB客户端在增加过滤条件后,点击查询获得的结果不一致,根据后台数据库日志,可知GTK自定义的条件未提交.WEB客户端获得了正确的结果GTK却查询不出来,后台数据库日志捕获语句也不一样,相关图片见附件<br />

    <br />根据不同的协议(net-rpc使用的是unicode,xml-rpc使用的是utf-8编码)OPENERP客户端储存了不同编码的值,而gtk客户端界面组件glade固定返回的编码为utf-8,在点击查找后,进行匹配时,无法找到对应的值,修改代码,将内存中全部转换为unicode,glade返回值也转换为unicode,修改如下(openerp-client-6.0.3/bin/widget_search/custom_filter.py):<br />fields = attrs.get(&#039;fields&#039;,None)<br />for item in fields:<br />#add by py 将索引字段强制换成unicode<br />self.field_selection[unicode(item[1])] = (item[0], item[2], item[3])<br />#以下为原来的代码<br />#self.field_selection[item[1]] = (item[0], item[2], item[3])<br />#end by py<br />self.combo_fields.append_text(item[1])<br /><br />self.combo_fields.set_active(0)<br /><br />for item in (&#91;&#039;ilike&#039;, _(&#039;contains&#039;)],<br />&#91;&#039;not ilike&#039;, _(&#039;doesn\&#039;t contain&#039;)],<br />&#91;&#039;=&#039;, _(&#039;is equal to&#039;)],<br />&#91;&#039;&lt;&gt;&#039;,_(&#039;is not equal to&#039;)],<br />&#91;&#039;&gt;&#039;,_(&#039;greater than&#039;)],<br />&#91;&#039;&lt;&#039;,_(&#039;less than&#039;)],<br />&#91;&#039;in&#039;,_(&#039;in&#039;)],<br />&#91;&#039;not in&#039;,_(&#039;not in&#039;)],<br />):<br />#add by py 将索引字段强制换成unicode<br />self.op_selection[unicode(item[1])] = item[0]<br />#以下为原来的代码<br />#self.op_selection[item[1]] = item[0]<br />#end by py<br />self.combo_op.append_text(item[1])<br /><br />self.combo_op.set_active(0)<br />false_value_domain = &#91;]<br />type_cast = {&#039;integer&#039;:lambda x:int(x),<br />&#039;float&#039;:lambda x:float(x),<br />&#039;boolean&#039;:lambda x:bool(eval(x)),<br />&#039;date&#039;:lambda x:(datetime.strptime(x, DT_FORMAT)).strftime(DT_FORMAT),<br />&#039;datetime&#039;:lambda x:(datetime.strptime(x, DHM_FORMAT)).strftime(DHM_FORMAT)<br />}<br />#add by py<br />field_left = self.field_selection[unicode(self.combo_fields.get_active_text())][0]<br />field_type = self.field_selection[unicode(self.combo_fields.get_active_text())][1]<br />operator = self.op_selection[unicode(self.combo_op.get_active_text())]<br />#以下为原来的代码<br />#field_left = self.field_selection[self.combo_fields.get_active_text()][0]<br />#field_type = self.field_selection[self.combo_fields.get_active_text()][1]<br />#operator = self.op_selection[self.combo_op.get_active_text()]<br />#end by py<br />right_text = self.right_text.get_text() or False <br />