[quote author=emc link=topic=17362.msg31275#msg31275 date=1446260848]
可以自定义修改搜索视图的。
找到销售订单对应的搜索视图,把自定义字段加进去。
路径:设置>>技术设置>>用户界面>>视图,找到sale.order.list.select,修改成这样:
<?xml version="1.0"?>
<search string="Search Sales Order">
<field name="name" string="Sales Order" filter_domain="['|',('name','ilike',self),('client_order_ref','ilike',self)]"/>
<field name="partner_id" operator="child_of"/>
<field name="user_id"/>
<field name="section_id" string="Sales Team" groups="base.group_multi_salesteams"/>
<field name="project_id"/>
<field name="product_id"/>
[color=red]<field name="x_order_type"/> #可以在搜索框里搜索[/color]
<filter string="My" domain="[('user_id','=',uid)]" name="my_sale_orders_filter"/>
<separator/>
<filter string="Quotations" name="draft" domain="[('state','in',('draft','sent'))]" help="Sales Order that haven't yet been confirmed"/>
<filter string="Sales" name="sales" domain="[('state','in',('manual','progress'))]"/>
<filter string="To Invoice" domain="[('state','=','manual')]" help="Sales Order ready to be invoiced"/>
<filter string="Done" domain="[('state','=','done')]" help="Sales Order done"/>
[color=red]<filter string="E-Commerce" domain="[('x_order_type','=','e-commerce')]" help="E-Commerce Orders"/> #过滤器里增加E-Commerce[/color]
[color=red]<filter string="PoS" domain="[('x_order_type','=','pos')]" help="PoS Orders"/> #过滤里增加PoS[/color]
<separator/>
<filter string="New Mail" name="message_unread" domain="[('message_unread','=',True)]"/>
<group expand="0" string="Group By">
<filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Customer" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Order Month" domain="[]" context="{'group_by':'date_order'}"/>
[color=red]<filter string="Order Type" domain="[]" context="{'group_by':'x_order_type'}"/> #分组里增加按Order Type汇总[/color]
</group>
</search>
[color=red]注意我自定义字段x_order_type的字段类型是selection类[/color]
[/quote]
非常感谢!
您发帖不多,但感觉你对Odoo已经很熟悉了。