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

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

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

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

OE 之搜索效率问题



  • 先看一段search的代码<br />

    <br />&lt;record model=&quot;ir.ui.view&quot; id=&quot;dispatch_work_order_filter&quot;&gt;<br />&lt;field name=&quot;name&quot;&gt;dispatch.work_order.filter&lt;/field&gt;<br />&lt;field name=&quot;model&quot;&gt;dispatch.work_order&lt;/field&gt;<br />&lt;field name=&quot;type&quot;&gt;search&lt;/field&gt;<br />&lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt;<br />&lt;search string=&quot;工单&quot;&gt;<br />&lt;field name=&quot;name&quot;/&gt;<br />&lt;field name=&quot;customer&quot;/&gt;<br />&lt;field name=&quot;mobile&quot;/&gt;<br />&lt;field name=&quot;phone&quot;/&gt;<br />&lt;field name=&quot;address&quot;/&gt;<br />&lt;field name=&quot;service_card&quot;/&gt;<br />&lt;field name=&quot;brand&quot;/&gt;<br />&lt;field name=&quot;series_number&quot;/&gt;<br />&lt;field name=&quot;area&quot;/&gt;<br />&lt;field name=&quot;client_source&quot;/&gt;<br />&lt;field name=&quot;buy_address&quot;/&gt;<br />&lt;field name=&quot;engineer&quot;/&gt;<br />&lt;field name=&quot;department&quot;/&gt;<br />&lt;field name=&quot;note&quot;/&gt;<br />&lt;field name=&quot;check_result&quot;/&gt;<br />&lt;field name=&quot;measure&quot;/&gt;<br />&lt;field name=&quot;description_of_fault&quot;/&gt;<br />&lt;field name=&quot;bill_date&quot; string=&quot;开单日期等于&quot; filter_domain=&quot;[(&#039;bill_date&#039;,&#039;=&#039;,self)]&quot;/&gt;<br />&lt;field name=&quot;bill_date&quot; string=&quot;开单日期大于&quot; filter_domain=&quot;[(&#039;bill_date&#039;,&#039;&gt;&#039;,self)]&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;field name=&quot;bill_date&quot; string=&quot;开单日期小于&quot; filter_domain=&quot;[(&#039;bill_date&#039;,&#039;&lt;&#039;,self)]&quot;/&gt;<br />&lt;field name=&quot;appointment_date&quot; string=&quot;预约日期等于&quot; filter_domain=&quot;[(&#039;appointment_date&#039;,&#039;=&#039;,self)]&quot;/&gt;<br />&lt;field name=&quot;appointment_date&quot; string=&quot;预约日期大于&quot; filter_domain=&quot;[(&#039;appointment_date&#039;,&#039;&gt;&#039;,self)]&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;field name=&quot;appointment_date&quot; string=&quot;预约日期小于&quot; filter_domain=&quot;[(&#039;appointment_date&#039;,&#039;&lt;&#039;,self)]&quot;/&gt;<br />&lt;field name=&quot;visit_time&quot; string=&quot;回访日期等于&quot; filter_domain=&quot;[(&#039;appointment_date&#039;,&#039;=&#039;,self)]&quot;/&gt;<br />&lt;field name=&quot;visit_time&quot; string=&quot;回访日期大于&quot; filter_domain=&quot;[(&#039;appointment_date&#039;,&#039;&gt;&#039;,self)]&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;field name=&quot;visit_time&quot; string=&quot;回访日期小于&quot; filter_domain=&quot;[(&#039;appointment_date&#039;,&#039;&lt;&#039;,self)]&quot;/&gt;<br />&lt;field name=&quot;done_date&quot; string=&quot;完工日期等于&quot; filter_domain=&quot;[(&#039;done_date&#039;,&#039;=&#039;,self)]&quot;/&gt;<br />&lt;field name=&quot;done_date&quot; string=&quot;完工日期大于&quot; filter_domain=&quot;[(&#039;done_date&#039;,&#039;&gt;&#039;,self)]&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;field name=&quot;done_date&quot; string=&quot;完工日期小于&quot; filter_domain=&quot;[(&#039;done_date&#039;,&#039;&lt;&#039;,self)]&quot;/&gt;<br />&lt;field name=&quot;bill_month&quot;/&gt;<br />&lt;field name=&quot;create_uid&quot;/&gt;<br />&lt;field name=&quot;done_month&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;draft&#039;)]&quot; string=&quot;待派工&quot; name=&quot;done0&quot;/&gt;<br />&lt;filter icon=&quot;ter-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;dealing&#039;)]&quot; string=&quot;待报工&quot; name=&quot;dealing0&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;done&#039;)]&quot; string=&quot;待交单&quot; name=&quot;reply0&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;reply&#039;)]&quot; string=&quot;待回访&quot; name=&quot;visit0&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state_use_card&#039;,&#039;=&#039;,&#039;0&#039;)]&quot; string=&quot;不扣卡&quot; name=&quot;state_use_card0&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state_use_card&#039;,&#039;=&#039;,&#039;1&#039;)]&quot; string=&quot;需扣卡&quot; name=&quot;state_use_card1&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;draft&#039;)]&quot; string=&quot;草稿&quot; name=&quot;draft&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;dealing&#039;)]&quot; string=&quot;已派工&quot; name=&quot;dealing&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;done&#039;)]&quot; string=&quot;已完工&quot; name=&quot;done&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;reply&#039;)]&quot; string=&quot;已交单&quot; name=&quot;reply&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;state&#039;,&#039;=&#039;,&#039;visit&#039;)]&quot; string=&quot;已回访&quot; name=&quot;visit&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;evaluate&#039;,&#039;=&#039;,&#039;very_satisfied&#039;)]&quot; string=&quot;非常满意&quot; name=&quot;very_satisfied&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;evaluate&#039;,&#039;=&#039;,&#039;satisfied&#039;)]&quot; string=&quot;满意&quot; name=&quot;satisfied&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;evaluate&#039;,&#039;=&#039;,&#039;discontent&#039;)]&quot; string=&quot;不满&quot; name=&quot;discontent&quot;/&gt;<br />&lt;filter icon=&quot;terp-check&quot; domain=&quot;[(&#039;evaluate&#039;,&#039;=&#039;,&#039;visit&#039;)]&quot; string=&quot;非常不满&quot; name=&quot;very_discontent&quot;/&gt;<br />&lt;separator/&gt;<br />&lt;group expand=&quot;0&quot; string=&quot;分组&quot;&gt;<br />&lt;filter string=&quot;按月&quot; icon=&quot;terp-personal&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;bill_month&#039;}&quot;/&gt;<br />&lt;filter string=&quot;客户&quot; icon=&quot;terp-personal&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;customer&#039;}&quot;/&gt;<br />&lt;filter string=&quot;服务卡&quot; icon=&quot;terp-personal&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;service_card&#039;}&quot;/&gt;<br />&lt;filter string=&quot;品牌型号&quot; icon=&quot;terp-personal+&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;brand&#039;}&quot;/&gt;<br />&lt;filter string=&quot;工程师&quot; icon=&quot;terp-personal&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;engineer&#039;}&quot;/&gt;<br />&lt;filter string=&quot;部门&quot; icon=&quot;terp-personal+&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;department&#039;}&quot;/&gt;<br />&lt;filter string=&quot;区域&quot; icon=&quot;terp-personal+&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;area&#039;}&quot;/&gt;<br />&lt;filter string=&quot;客户来源&quot; icon=&quot;terp-personal+&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;client_source&#039;}&quot;/&gt;<br />&lt;filter string=&quot;购机地点&quot; icon=&quot;terp-personal+&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;buy_address&#039;}&quot;/&gt;<br />&lt;filter string=&quot;维修类型&quot; icon=&quot;terp-personal+&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;warranty_type&#039;}&quot;/&gt;<br />&lt;filter string=&quot;维修方式&quot; icon=&quot;terp-personal+&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;repair_method&#039;}&quot;/&gt;<br />&lt;filter string=&quot;客户评价&quot; icon=&quot;terp-personal+&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;evaluate&#039;}&quot;/&gt;<br />&lt;filter string=&quot;状态&quot; icon=&quot;terp-stock_effects-object-colorize&quot; domain=&quot;&#91;]&quot; context=&quot;{&#039;group_by&#039;:&#039;state&#039;}&quot;/&gt;<br />&lt;/group&gt;<br />&lt;/search&gt;<br />&lt;/field&gt;<br />&lt;/record&gt;<br />
    

    <br /><br />要说明什么问题呢?<br />当用户数据量比较多的时候,这样的搜索视图效率就会越来越低。<br />原因是OE是根据输入不断的向服务器请求数据。如果用户输入速度慢,同时匹配的数据项由比较多,那么原先出于人体工学考虑的搜索就会出现卡顿现象。<br /><br />有两个方法可以解决,一是search不要太复杂,二是用wizard做精准的搜索条件然后一次提交。<br /><br />



  • 有道理